Skip to content
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

feat(condo): DOMA-10226 add full stacked gql error traces #5243

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

pahaz
Copy link
Member

@pahaz pahaz commented Sep 16, 2024

Improve developer experience. And show what the real original error. And provide a full stack trace with internal and intermediate errors.

Copy link

sonarcloud bot commented Sep 20, 2024

@pahaz pahaz changed the title refactor(condo): DOMA-10227 remove ensure-error feat(condo): DOMA-10226 add full stacked gql error traces Sep 20, 2024
* @param {Error} error -- any error
* @param {Boolean} hideInternals -- do you need to hide some internal error fields
* @param {Boolean} applyPatches -- do you need to apply a common error message patches
* @returns {import('graphql').GraphQLFormattedError}
*/
const safeFormatError = (error, hideInternals = false, applyPatches = true) => {
const safeFormatError = (errorIn, hideInternals = false, applyPatches = true, _isRecursionCall = false) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s better to create another internal function with third argument.

@@ -138,7 +137,7 @@ function setAllFeatureFlags (value) {
function setFakeClientMode (entryPoint, prepareKeystoneOptions = {}) {
if (__expressApp !== null) return
if (__isAwaiting) return
console.warn('setFakeClientMode(): you changed the test execution mode to FAKE client! Your test will not really make a request to remote server! Use it only for local debugging or .spec.js tests cases')
// console.warn('setFakeClientMode(): you changed the test execution mode to FAKE client! Your test will not really make a request to remote server! Use it only for local debugging or .spec.js tests cases')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like some local development stuff

@pahaz pahaz marked this pull request as draft September 20, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant