This commit is contained in:
Brian Neumann-Fopiano
2026-08-13 12:38:08 -04:00
parent 14b6280668
commit 1586b4bd1a
68 changed files with 733 additions and 211 deletions
@@ -97,6 +97,11 @@ public final class IrisLogging {
inner.printStackTrace(System.err);
}
if (IrisPlatforms.isBound()) {
IrisPlatforms.get().reportError(message, cause);
return;
}
reportError(cause);
cause.printStackTrace(System.err);
}
@@ -195,4 +195,17 @@ public interface IrisPlatform {
* Hands a throwable to the host's error reporting. Safe from any thread; must not rethrow.
*/
void reportError(Throwable error);
/**
* Contextual variant of {@link #reportError(Throwable)}. The platform owns trace emission so
* each adapter prints exactly one copy and its own suppression (throttles, debug gates) is
* honored; the default preserves the historical behavior of reporting plus an unconditional
* stack trace on stderr.
*/
default void reportError(String context, Throwable error) {
reportError(error);
if (error != null) {
error.printStackTrace(System.err);
}
}
}