Skip to content

Commit e4cd39a

Browse files
committed
Catch std::runtime_error by const reference.
Catching polymorphic types by value does not retain polymorphic behaviour.
1 parent 4f8f220 commit e4cd39a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scitokens_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class Validator {
298298
std::string key_id;
299299
try {
300300
key_id = jwt.get_key_id();
301-
} catch (std::runtime_error) {
301+
} catch (const std::runtime_error&) {
302302
// Don't do anything, key_id is empty, as it should be.
303303
}
304304

0 commit comments

Comments
 (0)