Dont flag endorsements fail on unregistered error

This commit is contained in:
Jamie Kyle 2024-09-17 16:11:25 -07:00 committed by GitHub
parent c11a894ad1
commit 6deb1594fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 12 deletions

View file

@ -5,16 +5,22 @@ import { getEnvironment, Environment } from '../environment';
import * as log from '../logging/log';
import * as Errors from '../types/errors';
/**
* In development, starts the debugger.
*/
export function devDebugger(): void {
if (getEnvironment() === Environment.Development) {
debugger; // eslint-disable-line no-debugger
}
}
/**
* In production and beta, logs a warning and continues. For development it
* starts the debugger.
*/
export function softAssert(condition: unknown, message: string): void {
if (!condition) {
if (getEnvironment() === Environment.Development) {
debugger; // eslint-disable-line no-debugger
}
devDebugger();
const err = new Error(message);
log.warn('softAssert failure:', Errors.toLogFormat(err));
}
@ -30,9 +36,7 @@ export function assertDev(
if (!condition) {
const err = new Error(message);
if (getEnvironment() !== Environment.PackagedApp) {
if (getEnvironment() === Environment.Development) {
debugger; // eslint-disable-line no-debugger
}
devDebugger();
throw err;
}
log.error('assert failure:', Errors.toLogFormat(err));