git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Tidy up position info in errors
commitdada38f855637aa8815990055c00dfa7b77c6ca8 authorPhil Freeman <paf31@cantab.net> dateSun 22 Feb 2015, 19:13 (12 years ago) parent7576a3a
1 file changed+6−2
src/Language/PureScript/Errors.hs+6−2
src/Language/PureScript/Errors.hs+6−2
@@ -204,7 +204,7 @@ errorCode (PositionedError _ e) = errorCode e
204204--
205205prettyPrintErrorMessage :: ErrorMessage -> String
206206prettyPrintErrorMessage 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."
208208 where
209209 wikiUri :: String
210210 wikiUri = "http://wiki.purescript.org/Error-Code-" ++ errorCode e
@@ -395,7 +395,11 @@ rethrow f = flip catchError $ \e -> throwError (f e)
395395-- Rethrow an error with source position information
396396--
397397rethrowWithPosition :: (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
399403
400404-- |
401405-- Collect errors in in parallel