Committed by
Charles Chan
Changing error message in case of no pipeliner
Change-Id: I45f5708385b8dd5ff025f2c6821ce2d4a6ecec3f
Showing
3 changed files
with
9 additions
and
2 deletions
... | @@ -54,6 +54,11 @@ public enum ObjectiveError { | ... | @@ -54,6 +54,11 @@ public enum ObjectiveError { |
54 | BADPARAMS, | 54 | BADPARAMS, |
55 | 55 | ||
56 | /** | 56 | /** |
57 | + * The device has no pipeline driver to install objectives. | ||
58 | + */ | ||
59 | + NOPIPELINER, | ||
60 | + | ||
61 | + /** | ||
57 | * An unknown error occurred. | 62 | * An unknown error occurred. |
58 | */ | 63 | */ |
59 | UNKNOWN | 64 | UNKNOWN | ... | ... |
... | @@ -180,6 +180,7 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -180,6 +180,7 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
180 | } else { | 180 | } else { |
181 | pipeliner.filter((FilteringObjective) objective); | 181 | pipeliner.filter((FilteringObjective) objective); |
182 | } | 182 | } |
183 | + //Attempts to check if pipeliner is null for retry attempts | ||
183 | } else if (numAttempts < INSTALL_RETRY_ATTEMPTS) { | 184 | } else if (numAttempts < INSTALL_RETRY_ATTEMPTS) { |
184 | Thread.sleep(INSTALL_RETRY_INTERVAL); | 185 | Thread.sleep(INSTALL_RETRY_INTERVAL); |
185 | executorService.submit(new ObjectiveInstaller(deviceId, objective, numAttempts + 1)); | 186 | executorService.submit(new ObjectiveInstaller(deviceId, objective, numAttempts + 1)); |
... | @@ -187,8 +188,9 @@ public class FlowObjectiveManager implements FlowObjectiveService { | ... | @@ -187,8 +188,9 @@ public class FlowObjectiveManager implements FlowObjectiveService { |
187 | // Otherwise we've tried a few times and failed, report an | 188 | // Otherwise we've tried a few times and failed, report an |
188 | // error back to the user. | 189 | // error back to the user. |
189 | objective.context().ifPresent( | 190 | objective.context().ifPresent( |
190 | - c -> c.onError(objective, ObjectiveError.DEVICEMISSING)); | 191 | + c -> c.onError(objective, ObjectiveError.NOPIPELINER)); |
191 | } | 192 | } |
193 | + //Excpetion thrown | ||
192 | } catch (Exception e) { | 194 | } catch (Exception e) { |
193 | log.warn("Exception while installing flow objective", e); | 195 | log.warn("Exception while installing flow objective", e); |
194 | } | 196 | } | ... | ... |
... | @@ -206,7 +206,7 @@ public class FlowObjectiveCompositionManager implements FlowObjectiveService { | ... | @@ -206,7 +206,7 @@ public class FlowObjectiveCompositionManager implements FlowObjectiveService { |
206 | // Otherwise we've tried a few times and failed, report an | 206 | // Otherwise we've tried a few times and failed, report an |
207 | // error back to the user. | 207 | // error back to the user. |
208 | objective.context().ifPresent( | 208 | objective.context().ifPresent( |
209 | - c -> c.onError(objective, ObjectiveError.DEVICEMISSING)); | 209 | + c -> c.onError(objective, ObjectiveError.NOPIPELINER)); |
210 | } | 210 | } |
211 | } catch (Exception e) { | 211 | } catch (Exception e) { |
212 | log.warn("Exception while installing flow objective", e); | 212 | log.warn("Exception while installing flow objective", e); | ... | ... |
-
Please register or login to post a comment