freme-project / e-Link

Apache License 2.0
0 stars 0 forks source link

'documents': clearer error when providing a non-existing template ID #56

Closed pheyvaer closed 8 years ago

pheyvaer commented 8 years ago

Clearer error when calling documents with a non-existing, though valid, template ID.

Same for templates/{tempalteid}.

m1ci commented 8 years ago

currently the error for non-existing template is:

{
  "exception": "eu.freme.common.exception.TemplateNotFoundException",
  "path": "/e-link/documents",
  "message": "Could not find resource with id='123'",
  "error": "Not Found",
  "status": 404,
  "timestamp": 1445869852530
}

Whats your suggestion? What should be improved to make it more clear?

pheyvaer commented 8 years ago

The message now talkes about a resource but I assume it means a template?

m1ci commented 8 years ago

yes, it means template, however, this exception comes from a "generic" class - see https://github.com/freme-project/FREMECommon/blob/master/src/main/java/eu/freme/common/persistence/dao/OwnedResourceDAO.java#L84

@jnehring can we do smth with this?

pheyvaer commented 8 years ago

OK, it is not a big issue. As you said, the name of the exception already states the problem :)

jnehring commented 8 years ago

Thanks for reporting @pheyvaer . I think the error message is ok and it is not easy to implement a specific error message in the generic class. So lets leave it like it is.