docs: def jsend_output(fail_exception_classes=None):
      """
      Format task result to json output in jsend specification format. See:
      https://github.com/omniti-labs. Task return value must be dict or None.
  
      @param fail_exception_classes: exceptions which will produce 'fail' response
      status.
      """
  
      fail_exception_classes = fail_exception_classes if fail_exception_classes \
          else ()
  
      def decorator_fn(f):
  
          @wraps(f)
          @json_output
          def jsend_output_decorator(*args, **kwargs):
              try:
                  rv = f(*args, **kwargs)
              except fail_exception_classes as e:
                  return {'status': 'fail', 'data': {'message': str(e)}}
              except Exception as e:
                  logging.error(str(e) + "\n" + traceback.format_exc())
                  return {'status': 'error', 'message': 'Server error.'}
  
              if not isinstance(rv, dict) and rv is not None:
                  msg = 'jsend_output decorator error: task must return dict ' \
                        'or None.\nTask return value: {0}.'
                  logging.error(msg.format(rv))
                  return {'status': 'error', 'message': 'Server error.'}
  
              return {'status': 'success', 'data': rv}
  
          return jsend_output_decorator
  
      return decorator_fn