mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
@urbit/api: do not reconnect if there is a FatalError
This commit is contained in:
parent
3496a8e8bf
commit
66536bebcd
@ -14,6 +14,7 @@ import {
|
||||
SSEOptions,
|
||||
PokeHandlers,
|
||||
Message,
|
||||
FatalError,
|
||||
} from './types';
|
||||
import { hexString } from './utils';
|
||||
|
||||
@ -291,7 +292,7 @@ export class Urbit {
|
||||
},
|
||||
onerror: (error) => {
|
||||
console.warn(error);
|
||||
if (this.errorCount++ < 4) {
|
||||
if (!(error instanceof FatalError) && this.errorCount++ < 4) {
|
||||
this.onRetry && this.onRetry();
|
||||
return Math.pow(2, this.errorCount - 1) * 750;
|
||||
}
|
||||
@ -311,6 +312,9 @@ export class Urbit {
|
||||
*
|
||||
*/
|
||||
reset() {
|
||||
if(this.verbose) {
|
||||
console.log('resetting');
|
||||
}
|
||||
this.delete();
|
||||
this.abort.abort();
|
||||
this.abort = new AbortController();
|
||||
|
Loading…
Reference in New Issue
Block a user