arun11299 / cpp-jwt

JSON Web Token library for C++
MIT License
396 stars 111 forks source link

fix: add new case to AlgorithmErrCategory::message #76

Closed saurik closed 3 years ago

saurik commented 3 years ago

Without this patch, InvalidKeyError would result in "unknown algorithm error", and if you are using -Wswitch (such as I am) then the code doesn't compile at all.

./p2p/cpp-jwt/include/jwt/impl/error_codes.ipp:41:13: error: enumeration value 'InvalidKeyErr' not handled in switch [-Werror,-Wswitch]
    switch (static_cast<AlgorithmErrc>(ev))
            ^
saurik commented 3 years ago

@arun11299 I just read my patch again--which was me pushing something I'd done locally a long time ago--and noticed the "or something" in the error message... with the wonder if that's why you didn't fix this, I've removed that, in the hope that having a reasonable message there makes this commit-able, as-is, with less effort ;P.

arun11299 commented 3 years ago

@saurik Not really. This PR didn't catch my eye, so I missed it.

Thanks for the PR.