Skip to content

UNI015: Missing inner exception in rethrow

What and why

throw new X() in catch block without inner exception.

Rethrowing without an inner exception loses diagnostic context.

How to fix: pass the caught exception to the new exception constructor.

Fix guidance

Pass the caught exception as the inner exception when rethrowing.

Tags

reliability, exceptions

Suppression

Use // unilyze-disable-next-line UNI015 -- reason immediately before the reported line. These detector findings are line-based, so separate overload occurrences can be suppressed independently. For project-wide suppression, use "rules": { "UNI015": "off" }; use a baseline to freeze existing findings while reporting new ones.