File tree Expand file tree Collapse file tree
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import com .cloud .exception .InvalidParameterValueException ;
2323import com .cloud .utils .StringUtils ;
2424import com .cloud .utils .exception .CloudRuntimeException ;
25+ import feign .FeignException ;
2526import org .apache .cloudstack .engine .subsystem .api .storage .DataObject ;
2627import org .apache .cloudstack .storage .datastore .db .StoragePoolVO ;
2728import org .apache .cloudstack .storage .feign .model .Lun ;
@@ -247,15 +248,24 @@ public static boolean isOntapObjectNotFoundError(Throwable error) {
247248 if (error == null ) {
248249 return false ;
249250 }
251+ if (error instanceof FeignException ) {
252+ FeignException feignException = (FeignException ) error ;
253+ if (feignException .status () == 404 ) {
254+ return true ;
255+ }
256+ }
250257 String message = error .getMessage ();
251258 if (message != null ) {
252259 String lower = message .toLowerCase ();
253260 if (lower .contains ("404" ) || lower .contains ("not found" ) || lower .contains ("does not exist" )
254261 || lower .contains ("entry doesn't exist" )) {
255262 return true ;
256263 }
264+ } else {
265+ logger .warn ("Error message is null for exception: {}" , error .getClass ().getName ());
266+ return false ;
257267 }
258- return isOntapObjectNotFoundError ( error . getCause ()) ;
268+ return false ;
259269 }
260270
261271}
You can’t perform that action at this time.
0 commit comments