freme-project / e-Link

Apache License 2.0
0 stars 0 forks source link

Bad Error Message #61

Closed jnehring closed 8 years ago

jnehring commented 8 years ago

This CURL

curl -X POST --header "Content-Type: application/json" --header "Accept: text/turtle" "http://api-dev.freme-project.eu/current/e-link/explore?resource=http%3A%2F%2Fdbpedia.org%2Fresource%2FBerlin&endpoint=%20http%3A%2F%2Fdbpedia.org%2Fsparql&endpoint-type=sparql“

produces

{
    "exception": "eu.freme.broker.exception.InternalServerErrorException",
    "path": "/e-link/explore",
    "message": "Unknown problem. Please contact us.",
    "error": "Internal Server Error",
    "status": 500,
    "timestamp": 1446713168713
}

The problem is the endpoint parameter %20http%3A%2F%2Fdbpedia.org%2F which starts with a space character. The logfile contains this error message:

Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0:  http://dbpedia.org/sparql

Please catch this exception, transform it to BadRequestException, send error code 400 and this error message.

m1ci commented 8 years ago

fixed, please try again:

curl -X POST --header "Content-Type: application/json" --header "Accept: text/turtle" "http://api-dev.freme-project.eu/current/e-link/explore?resource=http%3A%2F%2Fdbpedia.org%2Fresource%2FBerlin&endpoint=%20http%3A%2F%2Fdbpedia.org%2Fsparql&endpoint-type=sparql"

The new error is:

{
  "exception": "eu.freme.broker.exception.InvalidTemplateEndpointException",
  "path": "/e-link/explore",
  "message": "The endpoint URL \" http://dbpedia.org/sparql\" is invalid.",
  "error": "Bad Request",
  "status": 400,
  "timestamp": 1446718223371
}
jnehring commented 8 years ago

Works fine!