Comments (3)
This puts burden on consumers to iterate through the stack trace in hopes of finding the actual reason for a failure. That process alone is sketchy at best, as the consumer would need to somehow know how long they should recurse into the stack trace in order to obtain a meaningful error message.
You are referring to programmatic access to the inner exception with the meaningful message, right?
from transient-cache.
Yes, algorithmically trying to deduce which inner exception has the most meaningful message.
from transient-cache.
I have another case where the exception messages are misleading. This one in particular is causing us a lot of issues.
At seemingly random times, CachePool::set()
seems to fail with the exception:
Could not write value for key "..." to cache
This exception is thrown here.
It's pretty evident that this is originating from the setTransient()
method, seeing as how it's the only thing inside the try..catch
block. The issue comes when we look deeper into that method.
The setTransient()
method, can actually throw two different types of exceptions:
- the one it throws itself (
RuntimeException
) - the one thrown by the
validateTransientKey()
call (RangeException
)
The method originally in question, CachePool::set()
catches RuntimeException
, but will catch both of these (since RangeException
extends RuntimeException
). And in doing so it re-throws a completely new exception with a completely vague message.
And because we simply report these "soft" non-critical errors as a toast popup to the user, we have no idea which of the two exceptions is actually being thrown.
Expected a PR today :) These exceptions re-throws are getting out of hand.
from transient-cache.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transient-cache.