Skip to content

Spec for verify_strict/3 missing {class, reason} results from try/catch #164

@brian-bk

Description

@brian-bk

I'm not an elixir expert, so apologies if I'm understanding this issue incorrectly. When trying to upgrade jose to 1.11.9, there's an added spec to verify_strict/3:

@spec verify_strict(t(), [String.t()], binary()) :: {valid? :: boolean(), jwt :: t(), jws :: JOSE.JWS.t()}

Our dialyzer check for our application is failing because we were anticipating such results like {:error, reason} in addition to the currently spec'd {valid? :: boolean(), jwt :: t(), jws :: JOSE.JWS.t()}. I believe that the catch result should also be added to the type spec, here is the catch code block:

erlang-jose/lib/jose/jwt.ex

Lines 352 to 355 in 09de6d2

catch
class, reason ->
{class, reason}
end
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions