Skip to content

COSE::KEY.cbor_decode raises NameError when unlisted error is raised and uri is not required #82

Description

@santiagorodriguez96

URI::InvalidURIError has been in COSE::KEY.cbor_decode's the rescue list since 00cbf5d, but nothing in the gem requires uri. Ruby checks rescue classes one by one, left to right, and stops at the first match. URI::InvalidURIError is last. So when the raised error matches none of the earlier classes, Ruby tries to resolve URI and fails:

require "cose/key"

deep = 0
129.times { deep = [deep] }

COSE::Key.cbor_decode(deep.to_cbor)
# master: NameError: uninitialized constant COSE::Key::URI

We should make it so that unlisted errors are propagated normally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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