Clarity theorytheory 0/50 · 0%
Data Types · easy

9. Response Types (ok, err)

Standardizing success and failure.

A `response` type is used for function return values that can fail. It can be `(ok value)` or `(err value)`. In a public function, returning `err` will roll back all state changes.

clarity
(ok true)
(err u404)

Check your understanding

  1. 1. What happens if a public function returns (err ...)?