Skip to content

Commit

Permalink
Add specific exception indicating wrong curationDataSelector (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohecker authored Oct 9, 2023
1 parent 8ccfe3e commit 0da8b68
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.devonfw.tools.solicitor.componentinfo.curation;

import com.devonfw.tools.solicitor.componentinfo.ComponentInfoAdapterException;

/**
* This exception is thrown when an attempt is made to access a non-existing curation data selector when trying to
* retrieve curations.
*
*/
public class ComponentInfoAdapterNonExistingCurationDataSelectorException extends ComponentInfoAdapterException {

/**
* Constructs a new ComponentInfoAdapterNonExistingCurationDataSelectorException with the specified detail message.
*
* @param message the detail message (which is saved for later retrieval by the getMessage() method).
*/
public ComponentInfoAdapterNonExistingCurationDataSelectorException(String message) {

super(message);
}

/**
* Constructs a new ComponentInfoAdapterNonExistingCurationDataSelectorException with the specified detail message and
* a nested Throwable cause.
*
* @param message the detail message (which is saved for later retrieval by the getMessage() method).
* @param cause the nested cause Throwable (which is saved for later retrieval by the getCause() method).
*/
public ComponentInfoAdapterNonExistingCurationDataSelectorException(String message, Throwable cause) {

super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ public interface CurationProvider {
* indicates that the default should be used.
* @return the curation data if it exists or <code>null</code> if no curation exist for the package.
* @throws ComponentInfoAdapterException if something unexpected happens
* @throws ComponentInfoAdapterNonExistingCurationDataSelectorException if the specified curationDataSelector could not be
* resolved
*/
ComponentInfoCuration findCurations(String packageUrl, String curationDataSelector)
throws ComponentInfoAdapterException;
throws ComponentInfoAdapterException, ComponentInfoAdapterNonExistingCurationDataSelectorException;

}

0 comments on commit 0da8b68

Please sign in to comment.