MCPcopy
hub / github.com/httpie/cli / handle_generic_error

Function handle_generic_error

httpie/core.py:54–67  ·  view source on GitHub ↗
(e, annotation=None)

Source from the content-addressed store, hash-verified

52 include_traceback = include_debug_info or '--traceback' in args
53
54 def handle_generic_error(e, annotation=None):
55 msg = str(e)
56 if hasattr(e, 'request'):
57 request = e.request
58 if hasattr(request, 'url'):
59 msg = (
60 f'{msg} while doing a {request.method}'
61 f' request to URL: {request.url}'
62 )
63 if annotation:
64 msg += annotation
65 env.log_error(f'{type(e).__name__}: {msg}')
66 if include_traceback:
67 raise
68
69 if include_debug_info:
70 print_debug_info(env)

Callers 1

raw_mainFunction · 0.85

Calls 1

log_errorMethod · 0.80

Tested by

no test coverage detected