Closed
Description
We were getting uncaught exceptions from this package (node version v14.21.3). After investigating the matter noticed we have
public createSession(url: string): http2.ClientHttp2Session {
if (!this.http2Session || this.isClosed ) {
const opts: http2.SecureClientSessionOptions = {
// Set local max concurrent stream limit to respect backend limit
peerMaxConcurrentStreams: 100,
ALPNProtocols: ['h2']
}
const http2Session = http2.connect(url, opts)
http2Session.on('goaway', (errorCode, _, opaqueData) => {
throw new FirebaseAppError(
AppErrorCodes.NETWORK_ERROR,
`Error while making requests: GOAWAY - ${opaqueData.toString()}, Error code: ${errorCode}`
);
})
http2Session.on('error', (error) => {
throw new FirebaseAppError(
AppErrorCodes.NETWORK_ERROR,
`Error while making requests: ${error}`
);
})
return http2Session
}
return this.http2Session
}
added in src/utils/api-request.ts (commit: e5001c1). Here when we throw errors in the callbacks there is no way we could catch it with a try...catch or .catch().