-
Couldn't load subscription status.
- Fork 48
Closed
webrpc/gen-typescript
#8Description
const buildResponse = (res: Response): Promise<any> => {
return res.text().then(text => {
let data
try {
data = JSON.parse(text)
} catch(error) {
throw WebrpcBadResponseError.new({
status: res.status,
cause: `JSON.parse(): ${error.message || ''}: response text: ${text}`},
)
}
if (!res.ok) {
const code: number = (typeof data.code === 'number') ? data.code : 0
throw (webrpcErrorByCode[code] || WebrpcError).new(data)
}
return data
})
}
I get an "error is of type unknown" from the generated code. Guess this is just a "type error", and might not affect execution.
For your information, I am running the v0.11.0 release.
Metadata
Metadata
Assignees
Labels
No labels