def format_error(exception, when, code): if not isinstance(exception, ncf.NcfError): exception = ncf.NcfError( "Unknown internal error during " + when, "Cause: " + str(exception) + "\n" + traceback.format_exc() ) error = jsonify({"error": ncf.format_errors([exception])}) error.status_code = code return error
def format_error(exception, when, code): if not isinstance(exception, ncf.NcfError): exception = ncf.NcfError( "Unknown internal error during " + when, "Cause: " + str(exception) + "\n" + traceback.format_exc()) error = jsonify({"error": ncf.format_errors([exception])}) error.status_code = code return error