Skip to content

[FEATURE] add typed exceptions - #4

Open
JoBalk wants to merge 1 commit into
mainfrom
20260811_rsc_typed-exceptions
Open

JoBalk wants to merge 1 commit into
mainfrom
20260811_rsc_typed-exceptions

Conversation

@JoBalk

@JoBalk JoBalk commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator
  • add Minitwin::Error marker module and five exception classes
  • raise Minitwin::DefinitionError/CompositionError/CoercionError from dsl.rb
  • raise Minitwin::ParseError from constructors.rb; wrap JSON::ParserError in from_json
  • raise Minitwin::AliasError from initialization.rb
  • document Minitwin's gem-specific exception classes

Comment on lines +65 to +66
rescue Minitwin::Error
raise

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soll hier wirklich eine "leere" Exception geworfen werden?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nein, die ist nicht leer. Ein raise in einem rescue re-raised die Exception exakt so, wie sie ist. Das ist erforderlich, damit die zweite rescue Klausel keine von unseren neuen Typen schluckt. (die erben von den dort gefangenen) Aus diesem Grund spielt die Reihenfolge hier eine große Rolle. Ich werde einen Kommentar ergänzen, damit das klar wird.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke, mach das gern.

* add Minitwin::Error marker module and five exception classes
* raise Minitwin::DefinitionError/CompositionError/CoercionError from dsl.rb
* raise Minitwin::ParseError from constructors.rb; wrap JSON::ParserError in from_json
* raise Minitwin::AliasError from initialization.rb
* document Minitwin's gem-specific exception classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants