Error handling for deleting posts