1# Example Error Messages
3## Before: Only First Missing Dependency
5In our initial implementation, you would only see:
9 Missing required dependency!
10 The layer requires: "config"
13You'd have to fix `config`, recompile, then see:
15Missing required dependency!
16The layer requires: "logger"
19And so on... one at a time.
23Now you see everything at once:
27 (config :: Config, logger :: Logger, database :: Database)
31test = runLayer { logger: { log: \_ -> pure unit } } needsThree
34Error shows **both** the specific problem AND the complete picture:
38 Missing required dependency!
40 The first missing field is:
44 ( config :: { port :: Int }
45 , database :: { query :: String -> Effect (Array String) }
46 , logger :: { log :: String -> Effect Unit }
50 ( logger :: { log :: String -> Effect Unit }
55- ๐ฏ **Actionable**: "Fix `config` first" - specific field name
56- ๐ **Complete context**: Full diff of required vs provided
57- ๐๏ธ **Visual comparison**: Instantly see:
58 - โ
`logger` is provided
59 - โ `config` is missing
60 - โ `database` is missing
62**Best of both worlds**: Specific actionable error + full context to understand the complete situation!
66The trick is to **thread the original `Row Type`s through the RowList recursion**:
72 (available :: RowList Type)
73 (requiredRow :: Row Type) -- โ Thread through!
74 (availableRow :: Row Type) -- โ Thread through!
77When we hit the error case (missing label), we have both complete rows available to print:
80else instance checkLabelExistsNotFound ::
82 ( Above (Text "The layer requires: ")
83 (Above (Quote requiredRow) -- โ Show complete required
84 (Above (Text "But you provided: ")
85 (Quote availableRow) -- โ Show complete available
89 CheckLabelExists label ty Nil requiredRow availableRow
92This gives you a **full context diff** instead of just the first error!
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list