silver
silver copied to clipboard
AbstractError.readableMessage gets overridden in a bad way
Created by @aterga on 2017-10-05 14:38
The method readableMessage
is overridden in many implementations of AbstractError
. Sometimes is takes two parameters, such as
def readableMessage(withId: Boolean = false, withPosition: Boolean = false): String
In particular, the readable message with both the arguments set to true is used by the testing mechanism (i.e., set test
and the ExpectedOutput
annotations).
The way I see it, if one wants to get all the info about an error, one should use toString
. If one is interested in the semantical difference between different aspects of the error (e.g., in context of json streaming for Viper IDE) — readableMessage
is expected to produce only the explanatory text of the error, but not the tag not error position.