sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <>
Subject [jira] [Commented] (SIS-189) InvalidDbaseFileFormatException should extend DataStoreException
Date Mon, 07 Dec 2015 19:01:11 GMT


Martin Desruisseaux commented on SIS-189:

I'm not sure we are talking about the same thing? My though was:

* Use only standard SQL exceptions, because any custom SQL exceptions would be inaccessible
to data store users anyway (only users who target specifically the Shapefile data store could
use them).
* Wrap the SQL exceptions into {{DataStoreException}} using the {{Throwable.initCause(Throwable)}}
method or the convenience method. There is no need to create dedicated subclasses of {{DataSourceException}}
(we can, but this is not mandatory).
* Eventually define some new {{DataStoreException}} subclasses for reproducing the ideas
caught by the current custom SQL exceptions. The focus would be on types of exception that
could happen with other kinds of data store too.

I don't think that Runtime exception like JPA 2 would help. The goal of checked exceptions
is to force us to consider the possibility that something goes wrong at a particular point
in the program, and runtime exceptions defeat this goal. It does not mean to put checked exceptions
everywhere, but I think that data store API is one place where they are worth.

> InvalidDbaseFileFormatException should extend DataStoreException
> ----------------------------------------------------------------
>                 Key: SIS-189
>                 URL:
>             Project: Spatial Information Systems
>          Issue Type: Sub-task
>          Components: Shapefile
>            Reporter: Martin Desruisseaux
>            Assignee: M. Le Bihan
>              Labels: JDBC
>             Fix For: 0.7
> {{InvalidDbaseFileFormatException}} currently extends {{SQLNonTransientException}}. But
the the fact that a {{DataStore}} uses SQL or I/O operations for fetching the data is considered
internal to the data store. The higher-level exception for data stores is rather {{DataStoreException}},
which may contain a {{SQLException}}, {{IOException}} or other kind of exceptions as its cause.

This message was sent by Atlassian JIRA

View raw message