Comments (1)
Funnily enough one of the main motivations for building Fault was sql.ErrNoRows
breaking some rules around error handling.
short history note...
Basically, by using that type in error checks, we're leaking the underlying database details to the service layer with "SQL" and tying the concept of "not found" to only SQL related queries. If something was "not found" when querying MongoDB, Elasticsearch or S3 that means (by following this pattern) we need 4 custom error types and 4 checks in every handler to translate these errors into HTTP status codes. And thus, Fault's ftag (originally called errtag) was born.
end of history note
With regards to withSql I like the idea and I think it's very useful. This use-case is exactly why Fault is designed with the simple func(error) error
pattern. And I'm happy to see the idea providing value!
However, I'm hesitant to add this to the library as it's quite use-case specific (raw sql usage without a library, some teams use ORMs, or Ent, or a different relational/non-relational database system.) And I'd imagine many teams wouldn't want all parameters of queries, which may contain sensitive information, be stored and potentially accessed for logging etc.
However, I think it would be good to add a section to the readme that links libraries that work well with Fault's wrapper interface.
from fault.
Related Issues (20)
- Make fault less opinionated on displaying "stack" trace and error messages together HOT 7
- Avoid dependencies HOT 2
- Refactor Flatten to first flatten the tree and then filter the results HOT 3
- Enable locations to be generated for the caller in libraries HOT 8
- Make fault.Wrap nil tolerant HOT 1
- More cleverly split up glued error messages
- Support Unwrap for multiple errors
- Underlying map is modified globally in fctx
- Not getting the expected output HOT 18
- Pass ...Wrapper list to New constructor
- Redesign fmsg to be less verbose and more useful. HOT 3
- Support multiple ftag HOT 5
- Support arbitrary value type in fctx metadata HOT 5
- v1.0 Roadmap - consolidate built-in wrappers and implement API and DX improvements. HOT 3
- De-duplication logic causes some sentinel error patterns to result in error chain losses
- Error chains are not aware of "non message" error wrappers HOT 1
- Message missing due to incomplete Format implementation
- Error prints do not include external errors in some cases HOT 1
- Play nicely with multierror libraries HOT 6
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 fault.