summaryrefslogtreecommitdiff
path: root/swiftstory/status.py
blob: fb8347bdf176ce6e37068b95a03de9a987407cd4 (plain)
1
2
3
4
5
6
7
8
import json


def error(msg, code=255):
    return json.dumps({'type': 'response', 'content': {'status': code, 'info': msg}})

def success(obj):
    return json.dumps({'type': 'response', 'content': {'status': 0, 'result': obj}})