logger icon indicating copy to clipboard operation
logger copied to clipboard

Why is StackTrace null-safe?

Open caseyryan opened this issue 3 years ago • 1 comments

The standard

try {
...
}
catch (e, s) {
 logger.e(e, s);
}

now throws Error: Invalid argument(s): Error parameter cannot take a StackTrace! at Object.throw_ [as throw] (http://localhost:5555/dart_sdk.js:5032:11) at logger.Logger.new.log (http://localhost:5555/packages/logger/src/log_filter.dart.lib.js:668:19)

Because dart throws StackTrace, not StackTrace?

caseyryan avatar Apr 10 '21 08:04 caseyryan

You just missing message param, logger.e('msg',e,s). And ! here is not a null-check operator, just an usual exclamation mark.

narumi147 avatar May 02 '21 02:05 narumi147