Skip to content

Error Handling #8

@angusmcleod

Description

@angusmcleod

I had a little trouble with getting the sdk to get the Silkey public key

Silkey::SDK.fetch_silkey_public_key

As I wasn't using an appropriate config (see other issue). The failure to fetch the key was triggering a redirect of the POST callback to the root path / from within the gem (which fails in discourse as that POST route doesn't exist).

There isn't a simple way to handle that type of eventuality from within the plugin. Ideally I'd like to be able to do something like this

begin
    Silkey::SDK.token_payload_verifier(token, Silkey::SDK.fetch_silkey_public_key)
rescue Silkey::AuthError, Silkey::BlahError => e
   ## handle
end

I can help you implement that, but just thought I'd get your initial thinking on this subject, i.e. error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions