You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by Michael van der Gulik <mi...@gmail.com> on 2020/02/16 21:45:37 UTC

Which Java version do we code against?

Hi.

I was looking at improving the error handling because I just got a
completely useless error message out of Olingo.

I was looking at ODataHandlerImpl.java:

} catch (final UriValidationException e) {
  ODataServerError serverError =
ODataExceptionHelper.createServerErrorObject(e, null);
  handleException(request, response, serverError, e);
} catch (final UriParserSemanticException e) {
  ODataServerError serverError =
ODataExceptionHelper.createServerErrorObject(e, null);
  handleException(request, response, serverError, e);
} catch (final UriParserSyntaxException e) {
  ODataServerError serverError =
ODataExceptionHelper.createServerErrorObject(e, null);
  handleException(request, response, serverError, e);

(etc, repeat for 12 exceptions).

Would it perhaps be time to code against Java 7 (or higher!) so these can
be combined into one line? Java 6 kind of happened in the stone age.

Thanks,
Michael.

Re: Which Java version do we code against?

Posted by Michael van der Gulik <mi...@gmail.com>.
Also, what logging framework are you using? I'm not seeing any logging
messages anywhere.

Any exception without a message (in my case, NullPointerException) gets
converted into a generic message (ODataExceptionHandler.java:163) and the
whole exception is basically lost.

Michael.

On Mon, Feb 17, 2020 at 10:45 AM Michael van der Gulik <mi...@gmail.com>
wrote:

> Hi.
>
> I was looking at improving the error handling because I just got a
> completely useless error message out of Olingo.
>
> I was looking at ODataHandlerImpl.java:
>
> } catch (final UriValidationException e) {
>   ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
>   handleException(request, response, serverError, e);
> } catch (final UriParserSemanticException e) {
>   ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
>   handleException(request, response, serverError, e);
> } catch (final UriParserSyntaxException e) {
>   ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
>   handleException(request, response, serverError, e);
>
> (etc, repeat for 12 exceptions).
>
> Would it perhaps be time to code against Java 7 (or higher!) so these can
> be combined into one line? Java 6 kind of happened in the stone age.
>
> Thanks,
> Michael.
>


-- 
http://gulik.pbwiki.com/

Re: Which Java version do we code against?

Posted by Michael van der Gulik <mi...@gmail.com>.
I take that back. In pom.xml:

<project.build.source>1.8</project.build.source>

I need to engage my brain next time.

Thanks,
Michael.

On Mon, Feb 17, 2020 at 10:45 AM Michael van der Gulik <mi...@gmail.com>
wrote:

> Hi.
>
> I was looking at improving the error handling because I just got a
> completely useless error message out of Olingo.
>
> I was looking at ODataHandlerImpl.java:
>
> } catch (final UriValidationException e) {
>   ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
>   handleException(request, response, serverError, e);
> } catch (final UriParserSemanticException e) {
>   ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
>   handleException(request, response, serverError, e);
> } catch (final UriParserSyntaxException e) {
>   ODataServerError serverError = ODataExceptionHelper.createServerErrorObject(e, null);
>   handleException(request, response, serverError, e);
>
> (etc, repeat for 12 exceptions).
>
> Would it perhaps be time to code against Java 7 (or higher!) so these can
> be combined into one line? Java 6 kind of happened in the stone age.
>
> Thanks,
> Michael.
>


-- 
http://gulik.pbwiki.com/