|
|
|
|
|
by chrisguitarguy
1398 days ago
|
|
Log (and presumably) deal with errors if you _can deal with them_ close to where they occur. Otherwise just let them throw and/or propagate them up. An application should have some sort of top level error handling to log the error and actually return a response (HTTP 500 or otherwise) to the client. For something like a library: no logging, that's not a library's job -- unless it's a logging library! If the language has exceptions, then throwing only subclasses or implementations of a single exception parent/interface from the entire library is nice for clients of the library. |
|
An example which comes to mind because I happened to be looking at it is the python Requests library where they log inform about when new connections are created / destroyed which is very useful when debugging keep-alive.