You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Florent Guillaume (JIRA)" <ji...@apache.org> on 2009/07/20 15:07:14 UTC

[jira] Created: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Use specialized CMIS-related exceptions to deal with error cases
----------------------------------------------------------------

                 Key: CMIS-42
                 URL: https://issues.apache.org/jira/browse/CMIS-42
             Project: Chemistry
          Issue Type: Task
          Components: api
            Reporter: Florent Guillaume
            Assignee: Florent Guillaume


We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
First pass on the CMIS exception list:
General:
    invalidArgument -> java.lang.IllegalArgumentException
    notSupported -> java.lang.UnsupportedOperationException
    runtime -> java.lang.RuntimeException
    objectNotFound
    permissionDenied
Specific:
    constraint
    contentAlreadyExists
    filterNotValid
    folderNotValid
    storage
    streamNotSupported
    updateConflict
    versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788096#action_12788096 ] 

Florent Guillaume commented on CMIS-42:
---------------------------------------

Last comments fixed, see CMIS-68.


> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>         Attachments: patch-CMIS-42.txt
>
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Ugo Cei (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733527#action_12733527 ] 

Ugo Cei commented on CMIS-42:
-----------------------------

I second the preference for unchecked exceptions in general. However, I would have updateConflict, contentAlreadyExists (and possibly others, I'm not familiar with the error model of CMIS) as checked exceptions, since it's expected that those kind of errors could occur in normal situations and client code should deal with them appropriately.

> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - folderNotValid
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Amélie Avramo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amélie Avramo updated CMIS-42:
------------------------------

    Attachment: patch-CMIS-42.txt

Throws a ResponseContextException(409) when contentStream is null.

I've add a specific test for the AbderaServlet, since it doesn't works with Jaxrs because of the CMIS-69 issue.

> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>         Attachments: patch-CMIS-42.txt
>
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Amélie Avramo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782906#action_12782906 ] 

Amélie Avramo commented on CMIS-42:
-----------------------------------

Trying to get an empty content stream should throw a 404 HTTP error.
For now it returns a response 200.

> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780625#action_12780625 ] 

Florent Guillaume commented on CMIS-42:
---------------------------------------

For a first pass I'll use:

invalidArgument is java.lang.IllegalArgumentException
notSupported is java.lang.UnsupportedOperationException
runtime is java.lang.RuntimeException

FilterNotValidException extends IllegalArgumentException

CMISRuntimeException extends RuntimeException, with subclasses:
- ConstraintViolationException
- StreamNotSupportedException extends ConstraintViolationException
- ObjectNotFoundException
- PermissionDeniedException
- StorageException
- VersioningException

CMISException extends Exception, with subclasses:
- ContentAlreadyExistsException
- NameConstraintViolationException
- UpdateConflictException


> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume updated CMIS-42:
----------------------------------

    Description: 
We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.

First pass on the CMIS exception list:
General:
- invalidArgument -> java.lang.IllegalArgumentException
- notSupported -> java.lang.UnsupportedOperationException
- runtime -> java.lang.RuntimeException
- objectNotFound
- permissionDenied

Specific:
- constraint
- contentAlreadyExists
- filterNotValid
- folderNotValid
- storage
- streamNotSupported
- updateConflict
- versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).


  was:
We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.

First pass on the CMIS exception list:
General:
- invalidArgument -> java.lang.IllegalArgumentException
- notSupported -> java.lang.UnsupportedOperationException
- runtime -> java.lang.RuntimeException
- objectNotFound
- permissionDenied
Specific:
- constraint
- contentAlreadyExists
- filterNotValid
- folderNotValid
- storage
- streamNotSupported
- updateConflict
- versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).



> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - folderNotValid
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume resolved CMIS-42.
-----------------------------------

    Resolution: Fixed

r883013

We may revisit in the future which exceptions are checked (if any) and which are not, based on feedback from users of the API.


> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume updated CMIS-42:
----------------------------------

    Description: 
We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.

First pass on the CMIS exception list:
General:
- invalidArgument -> java.lang.IllegalArgumentException
- notSupported -> java.lang.UnsupportedOperationException
- runtime -> java.lang.RuntimeException
- objectNotFound
- permissionDenied

Specific:
- constraint
- contentAlreadyExists
- filterNotValid
- nameConstraintViolation
- storage
- streamNotSupported
- updateConflict
- versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).


  was:
We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.

First pass on the CMIS exception list:
General:
- invalidArgument -> java.lang.IllegalArgumentException
- notSupported -> java.lang.UnsupportedOperationException
- runtime -> java.lang.RuntimeException
- objectNotFound
- permissionDenied

Specific:
- constraint
- contentAlreadyExists
- filterNotValid
- folderNotValid
- storage
- streamNotSupported
- updateConflict
- versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).



> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume updated CMIS-42:
----------------------------------

    Description: 
We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.

First pass on the CMIS exception list:
General:
- invalidArgument -> java.lang.IllegalArgumentException
- notSupported -> java.lang.UnsupportedOperationException
- runtime -> java.lang.RuntimeException
- objectNotFound
- permissionDenied
Specific:
- constraint
- contentAlreadyExists
- filterNotValid
- folderNotValid
- storage
- streamNotSupported
- updateConflict
- versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).


  was:
We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
First pass on the CMIS exception list:
General:
    invalidArgument -> java.lang.IllegalArgumentException
    notSupported -> java.lang.UnsupportedOperationException
    runtime -> java.lang.RuntimeException
    objectNotFound
    permissionDenied
Specific:
    constraint
    contentAlreadyExists
    filterNotValid
    folderNotValid
    storage
    streamNotSupported
    updateConflict
    versioning

At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).



> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - folderNotValid
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CMIS-42) Use specialized CMIS-related exceptions to deal with error cases

Posted by "Amélie Avramo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782906#action_12782906 ] 

Amélie Avramo edited comment on CMIS-42 at 11/26/09 2:44 PM:
-------------------------------------------------------------

Trying to get an empty content stream should throw a 409 HTTP error.
For now it returns a response 200.

      was (Author: aavramo):
    Trying to get an empty content stream should throw a 404 HTTP error.
For now it returns a response 200.
  
> Use specialized CMIS-related exceptions to deal with error cases
> ----------------------------------------------------------------
>
>                 Key: CMIS-42
>                 URL: https://issues.apache.org/jira/browse/CMIS-42
>             Project: Chemistry
>          Issue Type: Task
>          Components: api
>            Reporter: Florent Guillaume
>            Assignee: Florent Guillaume
>
> We should use specialized exceptions (following what's defined in the spec's domain model) to treat error cases.
> First pass on the CMIS exception list:
> General:
> - invalidArgument -> java.lang.IllegalArgumentException
> - notSupported -> java.lang.UnsupportedOperationException
> - runtime -> java.lang.RuntimeException
> - objectNotFound
> - permissionDenied
> Specific:
> - constraint
> - contentAlreadyExists
> - filterNotValid
> - nameConstraintViolation
> - storage
> - streamNotSupported
> - updateConflict
> - versioning
> At least for the general CMIS exceptions I propose to use Java unchecked exception. Even for the specific ones I think we should minimize the number of checked exceptions (JCR showed that having too many of those on a single method is painful).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.