Moved error handling method, which was duplicated in FeedsController and FoldersController, to a separate module. This reduces code duplication.