99designs / 99designs/gqlgen

Returning nil from the error presenter causes a panic

未關閉
#1,733 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
10.8k
分支
1.3k
平均合併
2 天 36 分鐘
30 天內合併 PR
26

描述

### What happened?
I implemented the [error presenter](https://gqlgen.com/reference/errors/#the-error-presenter) and tried to return nil in an attempt to suppress a specific error. A panic then occurred on [this line](https://github.com/99designs/gqlgen/blob/v0.14.0/graphql/context_response.go#L113) stating `panic: interface conversion: error is *errors.errorString, not *gqlerror.Error`.

### What did you expect?
No panic and a suppressed error from the resulting response JSON.

### versions
- `gqlgen version`? 0.14.0
- `go version`? 1.17.3
- dep or go modules? go modules

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。