Comments (6)
You are right, but PostgreSQL is an extremely large and complex program. P3's mission is to be lean and mean.
Mapping all errors to different classes would be a lot of work.
It was a design decision to use just one error and one notification class (but it contains the actual DB error info).
So far this worked fine for me. How/where do you need more ?
from p3.
I think that it should be ok to have one just one error class but to use some aspect describing the problem or fill always some specific key in notice info.
For example, current code uses self error: 'Password required'
which does not give us any reasonable option to inform user in selected application language about the cause of problem.
In our application we use calls like pdmError: aSymbol text: aString attribute: anAttribute
(and shorter variants while the symbol needs to be always set). It signals a custom error instance and we can use the symbol as key for error translation using Gettext + provide next information from the rest of the arguments.
from p3.
See bf41906 for a new approach
This is based on how PostgreSQL errors are structured. Using #isLocal and #code you should have keys to work with, I hope.
from p3.
Thanks! in the commit, there seems to be a forgotten halt
from p3.
Ah yes, that method should not be called anyway, but I will remove it
from p3.
Done
from p3.
Related Issues (20)
- Additional types HOT 5
- Problems with setting the parameters of P3PreparedStatement HOT 5
- README.md typo HOT 1
- Is there a to-do list for this project... HOT 1
- connect to PGSQL 10.6. but error with Timezone class HOT 5
- Prepared statements error when query is long and differs slightly at the end HOT 7
- Use of pgcrypto, can't call crypt? HOT 24
- Tag reading when the database does not exist HOT 8
- Can't get P3 working after migration from Pharo 8 to 9 HOT 2
- Build against several PostgreSQL versions? HOT 1
- P3DatabaseDriver should have connectSSL HOT 2
- Reset in P3Client>>connect drop password HOT 2
- Pharo 9 - 'P3LogEvent logToTranscript' not working HOT 2
- Question about ip addr support HOT 8
- Unsupported frontend protocol 2.0: server supports 3.0 to 3.0 HOT 4
- Custom column type HOT 3
- P3LogEvent>>#logToTranscript calls deprecated Announcer>>#when:do:
- Bug with Pharo 7 HOT 5
- Can't handle array type HOT 7
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 p3.