Raise exeption API

 avatar
user_7886995
python
2 years ago
418 B
6
Indexable
@http.route('/test_hello', type='json', auth="user", cors="*")
def test_hello(self):
    raise exception.UnprocessableError('aaaa', 'bbbb')

@http.route('/test_hello_2', type='json', auth="user", cors="*")
def test_hello_2(self):
    delegate = exception.DelegateException()
    delegate.ex = exception.FoundRedirect('aaaa', 'bbbb')
    delegate.headers = [('Location', 'https://www.facebook.com/')]
    raise delegate
Editor is loading...