Using starlette 's HTTPException and WebSocketException as building blocks, implement a RichHTTPException cla
Using starlette 's HTTPException and WebSocketException as building blocks, implement a RichHTTPException cla: a task in repo2rlenv-code-instruct (Harbor dataset). RichHTTPException must subclass starlette.exceptions.HTTPException and add: - A context dict (arbitrary metadata, default {} ). - A is…
The task
`RichHTTPException` must subclass `starlette.exceptions.HTTPException` and add: - A `context` dict (arbitrary metadata, default `{}`). - A `is_client_error` property returning `True` if `status_code` is 4xx. - A `is_server_error` property returning `True` if `status_code` is 5xx.
Part of FineEnvs/repo2rlenv-code-instruct.