How to disable stacktrace to my error responses?
See original GitHub issueMy Query:
class HelloQuery: Query {
fun hello(): String {
throw GraphQLException("Something Wrong!")
}
}
application.yml
graphql:
federation:
enabled: true
packages:
- "com.aarestu"
server:
port: 8080
error:
include-stacktrace: never
if I execute query:
query {
hello
}
I got a response:
{
"errors": [
{
"message": "Exception while fetching data (/hello) : Something Wrong!",
"path": [
"hello"
],
"exception": {
"cause": null,
"stackTrace": [
{
"methodName": "hello",
"fileName": "HelloQuery.kt",
"lineNumber": 12,
"className": "com.aarestu.sample.graphql.query.HelloQuery",
"nativeMethod": false
},
.
.
.
.
{
"methodName": "run",
"fileName": "Thread.java",
"lineNumber": 748,
"className": "java.lang.Thread",
"nativeMethod": false
}
],
"localizedMessage": "Something Wrong!",
"message": "Something Wrong!",
"suppressed": []
},
"locations": [
{
"line": 2,
"column": 3,
"sourceName": null
}
],
"extensions": null,
"errorType": "DataFetchingException"
}
]
}
I want to remove field exception from my error response
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to prevent Internal Server Error Stack Trace from being ...
Solution. If necessary, the exceptions can be removed from the response. For example, you may customize the way the Web API handles exceptions...
Read more >Disable the default stacktrace error response in Jetty
In your WEB-INF/web.xml just specify an HTML (or Servlet, or JSP) that can handle your error. <web-app> <error-page> <!
Read more >How to avoid the detailed stack trace from showing up ... - IBM
But customer only wants to show an error message without detailed stack trace. This issue can be resolved via setting some WAS custom...
Read more >Hide / Remove Stack Trace information - Microsoft Q&A
Hide / Remove Stack Trace information · Assign an error page for error 400 via IIS and restarted IIS · Ensure the following...
Read more >Remove stack trace from APEX_ERROR in a Get response?
Anyone know how to remove the stacktrace info from the error message of custom exception? i tried overriding exception methods but it still ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unsure whats your
AppDataFetcherExceptionHandler
but assuming it would return your customGraphQLError
then yes it should work.I think by default
graphql-kotlin-spring-server
should not include exception stacktraces - created https://github.com/ExpediaGroup/graphql-kotlin/pull/369 to address it.Awesome!! @dariuszkuc