From 11f7687517adb3f4d5c604ee1cce30469392a7be Mon Sep 17 00:00:00 2001 From: Dan Cecile Date: Thu, 22 Aug 2024 11:31:53 -0400 Subject: [PATCH] Update README.md payload & error types (#75) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0560d6..2b6c635 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ result = call_api(1) result.success? # => true on success, false on failure result.failure? # => true on failure, false on success -result.payload # => nil on failure, payload type on failure -result.error # => nil on success, error type on failure +result.payload # => raises error on failure, payload type on failure +result.error # => raises error on success, error type on failure result.payload_or("fallback") # => returns payload on success, given value on failure # You can combine all the above to write flow-sensitive type-checked code