Juice/tools.py
2019-06-22 18:37:16 -04:00

15 lines
256 B
Python

#!/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