【发布时间】:2022-01-25 16:55:07
【问题描述】:
我尝试在我的解析器中捕获,捕获看起来像这样
catch (err: any) {
LOG.error("Failed to get location with ID: " + args.id);
LOG.error(err);
throw new Error(err);
}
当我在 graphql 中运行查询时,会出现以下错误消息
{
"errors": [
{
"message": "Error: \u001b[31m5 NOT_FOUND: Location was not found\u001b[39m",
"locations": [
{
"line": 34,
"column": 3
}
],
"path": [
"getLocation"
]
}
],
"data": {
"getLocation": null
}
如何从错误消息中删除 \u001b[31m5?
【问题讨论】:
标签: typescript graphql