(
outputs: nbformat.IOutput[],
errorOptions: SilentExecutionErrorOptions,
codeForLogging: string
)
| 824 | } |
| 825 | |
| 826 | function handleExecuteSilentErrors( |
| 827 | outputs: nbformat.IOutput[], |
| 828 | errorOptions: SilentExecutionErrorOptions, |
| 829 | codeForLogging: string |
| 830 | ) { |
| 831 | outputs |
| 832 | .filter((output) => { |
| 833 | return output.output_type === 'error'; |
| 834 | }) |
| 835 | .forEach((outputError) => { |
| 836 | const errorOutput = outputError as nbformat.IError; |
| 837 | const outputMessage = `${errorOutput.ename}: ${errorOutput.evalue} \n ${errorOutput.traceback |
| 838 | .map((line) => ` ${line}`) |
| 839 | .join('\n')}`; |
| 840 | const fullMessage = `${errorOptions.traceErrorsMessage || ''} ${codeForLogging} ${outputMessage}`; |
| 841 | if (errorOptions.traceErrors) { |
| 842 | logger.error(fullMessage); |
| 843 | } else { |
| 844 | logger.warn(fullMessage); |
| 845 | } |
| 846 | |
| 847 | // Send telemetry if requested, no traceback for PII |
| 848 | if (errorOptions.telemetryName) { |
| 849 | sendTelemetryEvent(errorOptions.telemetryName); |
| 850 | } |
| 851 | }); |
| 852 | } |
no test coverage detected