web: only report http errors for 500 and above
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		| @ -24,8 +24,13 @@ export function configureSentry(): Promise<Config> { | |||||||
|                         return null; |                         return null; | ||||||
|                     } |                     } | ||||||
|                     if (hint.originalException instanceof Response) { |                     if (hint.originalException instanceof Response) { | ||||||
|                         const body = await hint.originalException.json(); |                         const response = hint.originalException as Response; | ||||||
|                         event.message = `${hint.originalException.status} ${hint.originalException.url}: ${JSON.stringify(body)}` |                         // We only care about server errors | ||||||
|  |                         if (response.status < 500) { | ||||||
|  |                             return null; | ||||||
|  |                         } | ||||||
|  |                         const body = await response.json(); | ||||||
|  |                         event.message = `${response.status} ${response.url}: ${JSON.stringify(body)}` | ||||||
|                     } |                     } | ||||||
|                     if (event.exception) { |                     if (event.exception) { | ||||||
|                         me().then(user => { |                         me().then(user => { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer