We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello! I find unhandled exception in request() method of class Client. File src/client.ts line 33
request(command: string, body?: any) { const url = `${this.address}/api/${command}`; let init; if (body) { init = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }; } return new Promise((resolve, reject) => { fetch(url, init) .then((res) => { if (res.ok) return resolve(res.json()); throw res; }) // line with unhandled exception: .catch((e) => e.json().then((json) => reject(json))); // my fix: .catch((e) => { e.json() .then((json) => reject(json)) .catch((e) => reject(e)) }); }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello!
I find unhandled exception in request() method of class Client.
File src/client.ts line 33
The text was updated successfully, but these errors were encountered: