Record a script error from a string detail (origin already known).
Record a script error from a Throwable, capturing the full cause chain and stack trace.