@@ -101,7 +101,7 @@ List<AruPatch> getLatestPsu(AruProduct product, String version, String userId, S
101101 Document aruRecommendations = getRecommendedPatchesMetadata (product , releaseNumber , userId , password );
102102 logger .exiting ();
103103 return AruPatch .getPatches (aruRecommendations , "[./psu_bundle]" );
104- } catch (NoPatchesFoundException npe ) {
104+ } catch (NoPatchesFoundException | ReleaseNotFoundException ex ) {
105105 logger .exiting ();
106106 return Collections .emptyList ();
107107 } catch (IOException | XPathExpressionException e ) {
@@ -164,7 +164,9 @@ List<AruPatch> getRecommendedPatches(AruProduct product, String version, String
164164 patches .forEach (p -> logger .info ("IMG-0068" , product .description (), p .patchId (), p .description ()));
165165 logger .exiting (patches );
166166 return patches ;
167- } catch (NoPatchesFoundException npe ) {
167+ } catch (ReleaseNotFoundException nf ) {
168+ return Collections .emptyList ();
169+ } catch (NoPatchesFoundException npf ) {
168170 logger .info ("IMG-0069" , product .description (), version );
169171 return Collections .emptyList ();
170172 } catch (IOException | XPathExpressionException e ) {
@@ -305,6 +307,7 @@ Document getRecommendedPatchesMetadata(AruProduct product, String releaseNumber,
305307 * @param password OTN credential password
306308 * @return release number for the product and version provided
307309 * @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
308311 */
309312 private String getReleaseNumber (AruProduct product , String version , String userId , String password )
310313 throws AruException {
@@ -322,7 +325,9 @@ private String getReleaseNumber(AruProduct product, String version, String userI
322325 throw new AruException ("Could not extract release number with XPath" , xpe );
323326 }
324327 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 );
326331 }
327332 logger .exiting (result );
328333 return result ;
0 commit comments