diff options
author | beili.zhou <beili.zhou@amdocs.com> | 2017-08-29 18:33:57 -0400 |
---|---|---|
committer | Marcus Williams <marcus.williams@intel.com> | 2017-08-30 16:29:28 +0000 |
commit | a1194798f406efe32cb33510f1a9d58b0b5f9bd9 (patch) | |
tree | 21931fa9ba7e4023dd4d1998525e5529b944d209 /appc-oam/appc-oam-bundle/src/main | |
parent | 9a1e7032fae218bd820dc06436a52173fbae7d6e (diff) |
Remove catch throwable and error
Fix the following sonar blocker issue:
- Catch Exception instead of Throwable
- Catch Exception instead of Error
Issue-Id: APPC-175
Change-Id: I16a1018001b067216740ec11e5a97e52d714db69
Signed-off-by: beili.zhou <beili.zhou@amdocs.com>
Diffstat (limited to 'appc-oam/appc-oam-bundle/src/main')
3 files changed, 5 insertions, 4 deletions
diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java index c9ba0efa7..784beccc3 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/BaseProcessor.java @@ -92,8 +92,8 @@ public abstract class BaseProcessor extends BaseCommon { preProcess(requestInput); timeoutSeconds = operationHelper.getParamRequestTimeout(requestInput); scheduleAsyncTask(); - } catch (Throwable t) { - setErrorStatus(t); + } catch (Exception e) { + setErrorStatus(e); } finally { postProcess(); } diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java index d0d946aed..973d0af36 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/processor/OamMmodeProcessor.java @@ -129,8 +129,8 @@ public class OamMmodeProcessor extends BaseProcessor { } setStatus(OAMCommandStatus.SUCCESS); - } catch (Throwable t) { - setErrorStatus(t); + } catch (Exception e) { + setErrorStatus(e); hasError = true; } diff --git a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java index 25467da04..db6033752 100644 --- a/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java +++ b/appc-oam/appc-oam-bundle/src/main/java/org/openecomp/appc/oam/util/AsyncTaskHelper.java @@ -158,6 +158,7 @@ public class AsyncTaskHelper { task.cancel(false); if (task == backgroundOamTask) { backgroundOamTask = null; + taskRunnable = null; logDebug("Cancelling background task in cancel task."); } } |