@@ -101,7 +101,7 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, String userId, S
101
101
Document aruRecommendations = getRecommendedPatchesMetadata (product , releaseNumber , userId , password );
102
102
logger .exiting ();
103
103
return AruPatch .getPatches (aruRecommendations , "[./psu_bundle]" );
104
- } catch (NoPatchesFoundException npe ) {
104
+ } catch (NoPatchesFoundException | ReleaseNotFoundException ex ) {
105
105
logger .exiting ();
106
106
return Collections .emptyList ();
107
107
} catch (IOException | XPathExpressionException e ) {
@@ -164,7 +164,9 @@ List<AruPatch> getRecommendedPatches(AruProduct product, String version, String
164
164
patches .forEach (p -> logger .info ("IMG-0068" , product .description (), p .patchId (), p .description ()));
165
165
logger .exiting (patches );
166
166
return patches ;
167
- } catch (NoPatchesFoundException npe ) {
167
+ } catch (ReleaseNotFoundException nf ) {
168
+ return Collections .emptyList ();
169
+ } catch (NoPatchesFoundException npf ) {
168
170
logger .info ("IMG-0069" , product .description (), version );
169
171
return Collections .emptyList ();
170
172
} catch (IOException | XPathExpressionException e ) {
@@ -305,6 +307,7 @@ Document getRecommendedPatchesMetadata(AruProduct product, String releaseNumber,
305
307
* @param password OTN credential password
306
308
* @return release number for the product and version provided
307
309
* @throws AruException if the call to ARU fails, or the response from ARU had an error
310
+ * @throws ReleaseNotFoundException if the specified version for the requested product was not found
308
311
*/
309
312
private String getReleaseNumber (AruProduct product , String version , String userId , String password )
310
313
throws AruException {
@@ -322,7 +325,9 @@ private String getReleaseNumber(AruProduct product, String version, String userI
322
325
throw new AruException ("Could not extract release number with XPath" , xpe );
323
326
}
324
327
if (Utils .isEmptyString (result )) {
325
- throw new AruException (Utils .getMessage ("IMG-0082" , product , version ));
328
+ String msg = Utils .getMessage ("IMG-0082" , version , product );
329
+ logger .info (msg );
330
+ throw new ReleaseNotFoundException (msg );
326
331
}
327
332
logger .exiting (result );
328
333
return result ;
0 commit comments