MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / logSubErrors

Function logSubErrors

ses.cjs:6694–6723  ·  view source on GitHub ↗
(severity, subErrors, optTag=  undefined)

Source from the content-addressed store, hash-verified

6692 * @returns {void}
6693 */
6694 const logSubErrors= (severity, subErrors, optTag= undefined)=> {
6695 if( subErrors.length=== 0) {
6696 return;
6697 }
6698 if( subErrors.length=== 1&& optTag=== undefined) {
6699 // eslint-disable-next-line no-use-before-define
6700 logError(severity, subErrors[0]);
6701 return;
6702 }
6703 let label;
6704 if( subErrors.length=== 1) {
6705 label= `Nested error`;
6706 }else {
6707 label= `Nested ${subErrors.length} errors`;
6708 }
6709 if( optTag!== undefined) {
6710 label= `${label} under ${optTag}`;
6711 }
6712 // eslint-disable-next-line @endo/no-polymorphic-call
6713 baseConsole.group(label);
6714 try {
6715 for( const subError of subErrors) {
6716 // eslint-disable-next-line no-use-before-define
6717 logError(severity, subError);
6718 }
6719 }finally {
6720 // eslint-disable-next-line @endo/no-polymorphic-call
6721 baseConsole.groupEnd();
6722 }
6723 };
6724
6725 const errorsLogged= new WeakSet();
6726

Callers 3

makeNoteCallbackFunction · 0.85
logErrorFunction · 0.85
levelMethodFunction · 0.85

Calls 2

logErrorFunction · 0.85
groupMethod · 0.80

Tested by

no test coverage detected