diff --git a/r2/r2/lib/errors.py b/r2/r2/lib/errors.py index 291b4efe4..f7cece0ff 100644 --- a/r2/r2/lib/errors.py +++ b/r2/r2/lib/errors.py @@ -128,7 +128,7 @@ error_list = dict(( ('MULTI_CANNOT_EDIT', _('you can\'t change that multireddit')), ('MULTI_TOO_MANY_SUBREDDITS', _('no more space for subreddits in that multireddit')), ('MULTI_SPECIAL_SUBREDDIT', _("can't add special subreddit %(path)s")), - ('BAD_JSON', _('unable to parse JSON data')), + ('JSON_PARSE_ERROR', _('unable to parse JSON data')), )) errors = Storage([(e, e) for e in error_list.keys()]) diff --git a/r2/r2/lib/validator/validator.py b/r2/r2/lib/validator/validator.py index 1c7aa9a13..233a83d15 100644 --- a/r2/r2/lib/validator/validator.py +++ b/r2/r2/lib/validator/validator.py @@ -2183,12 +2183,12 @@ class VPermissions(Validator): class VJSON(Validator): def run(self, json_str): if not json_str: - return self.set_error('BAD_JSON', code=400) + return self.set_error('JSON_PARSE_ERROR', code=400) else: try: return json.loads(json_str) except ValueError: - return self.set_error('BAD_JSON', code=400) + return self.set_error('JSON_PARSE_ERROR', code=400) def param_docs(self): return {