freme-project / Broker

FREME Broker
Apache License 2.0
2 stars 0 forks source link

Error message when external service fails in /e-translation/tilde #140

Closed jnehring closed 8 years ago

jnehring commented 8 years ago

This CURL

curl -X POST --header "Content-Type: text/n3" --header "Accept: text/n3" "http://api.freme-project.eu/0.4/e-translation/tilde?input=%3Cp%3EWelcome%20to%20Berlin!%3C%2Fp%3E&informat=text%2Fhtml&outformat=text%2Fhtml&source-lang=en&target-lang=de"

produces http status code 406 and the message "no content".

When I try informat=text and outformat=turtle then I get

{
  "exception": "eu.freme.broker.exception.ExternalServiceFailedException",
  "path": "/e-translation/tilde",
  "message": "External service failed with status code 404",
  "error": "Not Found",
  "status": 404,
  "timestamp": 1448016282118
}
andish commented 8 years ago

there is a problem in en-de tranlsation system. We will recover asap.

andish commented 8 years ago

It should work now.

jnehring commented 8 years ago

Thanks @andish . Above CURL works now.

But I dont like the error message that FREME produced. So we should leave this ticket open to change the error message. This is low priority.

jnehring commented 8 years ago

@josauder please try to reproduce this error, e.g. via using a wrong endpoint URL to Tildes MT API. Then you can fix it. Check also if the same error occurs on e-Terminology.

ArneBinder commented 8 years ago

Now the body is forwarded if httpStatus!=200:

{
  "exception": "eu.freme.common.exception.ExternalServiceFailedException",
  "path": "/e-translation/tilde",
  "message": "External service failed: {\"Message\":\"No HTTP resource was found that matches the request URI 'http://banzai:91/translation/?sourceLXXXang=en&targetLang=de&system=full&domain=&key='.\"}",
  "error": "Not Found",
  "status": 404,
  "timestamp": 1459796787574
}

Also the status code is forwarded.

Is this ok?

jnehring commented 8 years ago

Perfect!