`ProcessPathErrors` cut the `path="..."` it pulled out of an error at the first `!/` and built nested
coordinates from it, so a host file with `!/` in its name was reported as a file inside an archive.
- paths from error text are taken as plain real paths again, as on main
- the php extension reader already has the location in hand, so it records the unknown against that
instead of re-parsing the error (this is the one caller that could see a nested path). It also
no longer defers `Close` on a nil reader when the read fails
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
* fix(generic): recover from parser and processor panics
- a panic while parsing one file becomes an unknown for that location instead of failing the whole SBOM
- a panic in a package processor is logged as a warning and the unprocessed results are kept
- stacks go to the trace log, not into the unknown text
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
* fix(unknown): keep errors that unwrap to nil
`sync.PanicError` with a non-error panic value (e.g. `panic("boom")`) unwraps to nil, and was being dropped entirely from the error graph instead of being kept as a leaf.
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
* fix(task): don't put the stack trace in task panic errors
Task panics are still fatal, but the error now reads `panic in task "<name>": <value>` and the stack goes to the debug log.
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
* test(generic): cover chained processors when a later one panics
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
* fix(file): recover from panics in the executable and file digest catalogers
A panic while reading one file is now recorded as an unknown for that file instead of failing the whole SBOM, the same as generic catalogers.
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
---------
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>