etf-validator / etf-webapp

:earth_africa: :mag: ETF is an open source testing framework for spatial data and services
https://www.etf-validator.net
European Union Public License 1.2
18 stars 19 forks source link

Monitor view: localizable JSON error messages are not shown #125

Closed jonherrmann closed 6 years ago

jonherrmann commented 7 years ago

JSON test run monitor response is not decoded correctly in monitor view.


{  
   "val":"282",
   "max":"334",
   "log":[  
      "16.08.2017 16:22:24 - Results received.",
      "16.08.2017 16:22:24 - Internal ETS model updated.",
      "16.08.2017 16:22:24 - Transforming results.",
      "16.08.2017 16:22:24 - 1 of 19 assertions passed",
      "16.08.2017 16:22:25 - Releasing resources",
      "16.08.2017 16:22:26 ERROR \u003cetfTranslate what=\u0027TR.missingSchemaLocation\u0027\u003e\u003celement\u003e@*:schemaLocation\u003c/element\u003e\u003cxpath\u003e/*:WFS_Capabilities/@*:schemaLocation\u003c/xpath\u003e\u003c/etfTranslate\u003e",
      "16.08.2017 16:22:26 ERROR Could not validate response: Missing xsi:schemaLocation attribute in response",
      "16.08.2017 16:22:26 ERROR \u003cetfTranslate what=\u0027TR.noOutputFormats\u0027\u003e\u003celement\u003e*:Value\u003c/element\u003e\u003cxpath\u003e//*:FeatureType[1]/*:OutputFormats/*:Format, /*:WFS_Capabilities/*:OperationsMetadata/*:Operation[@name=\u0027GetFeature\u0027]/*:Parameter[@name=\u0027outputFormat\u0027]/*:AllowedValues/*:Value\u003c/xpath\u003e\u003c/etfTranslate\u003e"
   ]
}

Ref: https://github.com/interactive-instruments/etf-webapp/blob/next/src/main/webapp/js/app/views/MonitorView.js#L115

jonherrmann commented 7 years ago

It does not really make sense to output messages like:

<etftranslate what="TR.missingSchemaLocation">
<element>@*:schemaLocation</element>
<xpath>/*:WFS_Capabilities/@*:schemaLocation</xpath>
</etftranslate>

in the monitor log.

New approach: check if thrown error is instance of LocalizableError and only output the ID (the what) (translating the message could be implemented in feature versions).