Skip to content

Fix: Avoid throwing methods on MockResponse#5

Merged
bstien merged 2 commits intomainfrom
fix/avoid-throwing-methods
Sep 1, 2025
Merged

Fix: Avoid throwing methods on MockResponse#5
bstien merged 2 commits intomainfrom
fix/avoid-throwing-methods

Conversation

@bstien
Copy link
Owner

@bstien bstien commented Sep 1, 2025

Why?

Letting the methods MockResponse.dictionary(…) and MockResponse.encodable(…) be able to throw errors felt a bit awkward, since none of the other methods are.

Instead we're now logging an error, along with the error and the failing dictionary or Encodable. These methods now default to return .empty(), just to have something to return.

What?

  • Perform encoding/serialization and catch any errors early.

@bstien bstien merged commit 0f270d0 into main Sep 1, 2025
1 check passed
@bstien bstien deleted the fix/avoid-throwing-methods branch September 4, 2025 05:43
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.

1 participant