(severity, subErrors, optTag= undefined)
| 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 |
no test coverage detected