@@ -4,6 +4,7 @@ import Prelude
44
55import Control.Monad.Error.Class (class MonadError, catchError, throwError)
66import Data.Argonaut.Core as Json
7+import Data.Bifunctor (lmap)
78import Data.Either (Either(..), note)
89import Data.Enum (class Enum, enumFromTo)
910import Data.List (List, fromFoldable)
@@ -362,6 +363,8 @@ instance argsFromRowsCons ::
362363 -- Extract the argument value if the node can be found. If not use null value
363364 -- TODO: Implement default values where we would try to use the default value first
364365 valueNode = map (\(AST.ArgumentNode { value }) -> value) argumentNode
366+ improveInputError err = "Error when reading variable '" <> reflectSymbol key <> "': " <> err
367+ resolvedValue = lmap improveInputError $ argConfig.resolveValue valueNode variables
365368 tail =
366369 argsFromRows
367370 (RLProxy :: RLProxy ltargsd)
@@ -369,7 +372,7 @@ instance argsFromRowsCons ::
369372 nodes
370373 variables
371374 tailArgsDef
372− in Record.insert key <$> (argConfig.resolveValue valueNode variables) <*> tail
375+ in Record.insert key <$> resolvedValue <*> tail
373376
374377else instance argsFromRowsNil :: ArgsFromRows RL.Nil RL.Nil argsd argsp where
375378 argsFromRows _ _ _ _ _ = pure $ unsafeCoerce {}