git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Tidy up position info in errors
dada38fPhil Freeman
src/Language/PureScript/Errors.hs+6−2
@@ -204,7 +204,7 @@ errorCode (PositionedError _ e) = errorCode e
204--
204--
205prettyPrintErrorMessage :: ErrorMessage -> String
205prettyPrintErrorMessage :: ErrorMessage -> String
206prettyPrintErrorMessage e =
206prettyPrintErrorMessage e =
207− go e ++ "\n\nUse --verbose-errors, or see " ++ wikiUri ++ " for more information."
207+ go e ++ "\n\nSee " ++ wikiUri ++ " for more information, or to contribute content related to this error."
208 where
208 where
209 wikiUri :: String
209 wikiUri :: String
210 wikiUri = "http://wiki.purescript.org/Error-Code-" ++ errorCode e
210 wikiUri = "http://wiki.purescript.org/Error-Code-" ++ errorCode e
@@ -395,7 +395,11 @@ rethrow f = flip catchError $ \e -> throwError (f e)
395-- Rethrow an error with source position information
395-- Rethrow an error with source position information
396--
396--
397rethrowWithPosition :: (MonadError MultipleErrors m) => SourceSpan -> m a -> m a
397rethrowWithPosition :: (MonadError MultipleErrors m) => SourceSpan -> m a -> m a
398−rethrowWithPosition pos = rethrow (onErrorMessages (PositionedError pos))
398+rethrowWithPosition pos = rethrow (onErrorMessages withPosition)
399+ where
400+ withPosition :: ErrorMessage -> ErrorMessage
401+ withPosition (PositionedError _ err) = withPosition err
402+ withPosition err = PositionedError pos err
399
403
400-- |
404-- |
401-- Collect errors in in parallel
405-- Collect errors in in parallel