Page URL: https://dart.dev/codelabs/dart-cheatsheet.html
Page source: https://github.com/dart-lang/site-www/tree/master/src/codelabs/dart-cheatsheet.md
Description of issue:
The solution one gets when clicking on the "Solution" tab in the code exercise of the Exceptions section, does not pass the tests:

This function passes the tests but is not exactly what the exercise aims for:
void tryFunction(VoidFunction untrustworthy, Logger logger) {
try {
untrustworthy();
} on ExceptionWithMessage catch (e) {
logger.logException(e.runtimeType, e.message);
} on Exception catch (e) {
logger.logException(e.runtimeType);
} finally {
logger.doneLogging();
}
}
@RedBrogdon could you please change _Exception to Exception here: https://gist.github.com/RedBrogdon/e221e3fd667825e62aac79079b8b5c59#file-test-dart-L21
That seems to make the test pass.
I've revised the gist so that either Exception or _Exception will pass the exercise. The solution used to work, which makes me wonder if one of the internal exception classes has been updated in the past few months.
These are the instructions for that part of the exercise:
If untrustworthy() throws an Exception, call logger.logException with the exception type (try using on for this one)
By specifically saying "use on to solve this one," I was trying to direct readers to catch by type and then use the Exception type directly when calling logException. I don't think anyone's wrong, though, to also use catch and return the runtime type of the exception itself. In my mind, they should both work. So rather than updating the solution, I've updated the test in the backing gist (https://gist.github.com/RedBrogdon/e221e3fd667825e62aac79079b8b5c59).
Thanks, @RedBrogdon. And big thanks to @tehsphinx for reporting this issue!