Use canonical_name in the exception message