Change exit code to `1` whenever an error was logged.
This is a preparation for CycloneDX/cyclonedx-javascript-library#1255
Adds a wrapper around the native console API to track if any errors were logged. If this is the case a non-zero exit code is set (via Clipanion as it sets exit codes after plugin commands are complete in https://github.com/arcanis/clipanion/blob/master/sources/advanced/Cli.ts#L551).
This PR does not include adding additional logs to address CycloneDX/cyclonedx-javascript-library#1255
Why so complicated? Why not simply throw on error?
What is even the use case? Continuing after a warning - sure, but why should the code continue after an error was detected?
I'd rather throw an Error - it probably is not even needed to catch it, as yarn's plugin handler would handle it, right?