-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Improve error message for disconnected connections #678
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -100,7 +100,7 @@ class HANAService extends SQLService { | |||
} | |||
|
|||
ensureDBC() { | |||
return this.dbc || cds.error`Database is disconnected` | |||
return this.dbc || cds.error`Database connection is ${this._done || 'disconnected'}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
return this.dbc || cds.error`Database connection is ${this._done || 'disconnected'}` | |
return this.dbc || cds.error`Database connection ${this._done ? 'is ' + this._done || 'failed'}` |
patricebender
approved these changes
Jun 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the error message I suggested reads better but no hard feelings
Merged
johannes-vogel
added a commit
that referenced
this pull request
Jun 19, 2024
🤖 I have created a release *beep* *boop* --- <details><summary>db-service: 1.10.1</summary> ## [1.10.1](db-service-v1.10.0...db-service-v1.10.1) (2024-06-19) ### Fixed * Only check first row if no changes required ([#552](#552)) ([39b0b85](39b0b85)) </details> <details><summary>sqlite: 1.7.2</summary> ## [1.7.2](sqlite-v1.7.1...sqlite-v1.7.2) (2024-06-19) ### Fixed * **deps:** update dependency better-sqlite3 to v11 ([#669](#669)) ([7167ec5](7167ec5)) </details> <details><summary>hana: 1.0.0</summary> ## [1.0.0](hana-v0.5.0...hana-v1.0.0) (2024-06-19) ### Fixed * Binary columns now return as Buffer for HANAService ([#689](#689)) ([179bd92](179bd92)) * Improve error message for disconnected connections ([#678](#678)) ([eb4ef37](eb4ef37)) * insertion of arrayed elements ([#677](#677)) ([92cf307](92cf307)) * insertion of large decimals ([#686](#686)) ([ae8abff](ae8abff)) * Support static conditions inside unmanaged associations ([#682](#682)) ([e17ddfd](e17ddfd)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com>
This was referenced Jan 28, 2025
Closed
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this._done
is used from the defaulttx
behavior. This can containcommitted
orrolled back
. Ifthis._done
is not set it means the connection was never connected.