示例#1
0
def client_error(_):
    return responses.fail('badRequest')
示例#2
0
def not_unique(_):
    return responses.fail('alreadyExists')
示例#3
0
def internal_server_error(_):
    return responses.fail('internalError', code=500)
示例#4
0
def invalid_credentials(_):
    return responses.fail('invalidCredentials')
示例#5
0
def data_error(error):
    return responses.fail('dataError',
                          additional={
                              'required_data': error.required_data,
                              'optional_data': error.optional_data
                          })
示例#6
0
def pagination_error(_):
    return responses.fail('invalidPage')
示例#7
0
def method_not_allowed(_):
    return responses.fail('methodNotAllowed', code=405)
示例#8
0
def page_not_found(_):
    return responses.fail('notFound', code=404)
示例#9
0
def forbidden(_):
    return responses.fail('forbidden', code=403)
示例#10
0
def unauthorized(_):
    return responses.fail('unauthorized', code=401)