Skip to content

Commit 54953fa

Browse files
committed
fix: Fix error handling in Registration
1 parent a54c0ab commit 54953fa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

handlers/Registration.cfc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ component secured {
139139
);
140140
} catch ( "com.yubico.webauthn.exception.RegistrationFailedException" e ) {
141141
if ( log.canError() ) {
142-
log.error( e.getMessage(), { "exception" : e } );
142+
log.error(
143+
structKeyExists( e, "message" ) ? e.message : ( structKeyExists( e, "getMessage" ) ? e.getMessage() : toString( e ) ),
144+
{ "exception" : e }
145+
);
143146
}
144147
event.renderData(
145148
type = "json",
@@ -151,7 +154,10 @@ component secured {
151154
return;
152155
} catch ( any e ) {
153156
if ( log.canError() ) {
154-
log.error( e.getMessage(), { "exception" : e } );
157+
log.error(
158+
structKeyExists( e, "message" ) ? e.message : ( structKeyExists( e, "getMessage" ) ? e.getMessage() : toString( e ) ),
159+
{ "exception" : e }
160+
);
155161
}
156162
rethrow;
157163
}

0 commit comments

Comments
 (0)