Skip to content

Commit

Permalink
Wrapping exceptions.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Jul 18, 2024
1 parent 163b9e4 commit ca5a54a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.opensearch.securityanalytics.threatIntel.common.RefreshType;
import org.opensearch.securityanalytics.threatIntel.common.TIFJobState;
import org.opensearch.securityanalytics.threatIntel.sacommons.TIFSourceConfigDto;
import org.opensearch.securityanalytics.util.SecurityAnalyticsException;

import java.io.IOException;
import java.time.Instant;
Expand Down Expand Up @@ -467,7 +468,7 @@ public static TIFJobState toState(String stateName) {
return TIFJobState.valueOf(stateName);
} catch (IllegalArgumentException e) {
log.error("Invalid state, cannot be parsed.", e);
return null;
throw SecurityAnalyticsException.wrap(e);
}
}

Expand All @@ -476,7 +477,7 @@ public static SourceConfigType toSourceConfigType(String type) {
return SourceConfigType.valueOf(type);
} catch (IllegalArgumentException e) {
log.error("Invalid source config type, cannot be parsed.", e);
return null;
throw SecurityAnalyticsException.wrap(e);
}
}

Expand All @@ -485,7 +486,7 @@ public static RefreshType toRefreshType(String stateName) {
return RefreshType.valueOf(stateName);
} catch (IllegalArgumentException e) {
log.error("Invalid refresh type, cannot be parsed.", e);
return null;
throw SecurityAnalyticsException.wrap(e);
}
}

Expand Down

0 comments on commit ca5a54a

Please sign in to comment.