Juice/tools.py

15 lines
256 B
Python
Raw Normal View History

2019-06-22 18:37:16 -04:00
#!/usr/bin/env python3
"""
Miscellaneous tools and helper functions.
"""
from flask import jsonify
def make_error(code, message):
"""
Returns a JSON error.
"""
res = jsonify(ok=False, status=code, message=message)
res.status_code = code
return res