File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -402,6 +402,7 @@ def create(self, deployment_instance):
402
402
self ._serving_api .put (deployment_instance )
403
403
print ("Deployment created, explore it at " + deployment_instance .get_url ())
404
404
except RestAPIError as re :
405
+ raise_err = True
405
406
if re .error_code == ModelServingException .ERROR_CODE_DUPLICATED_ENTRY :
406
407
msg = "Deployment with the same name already exists"
407
408
existing_deployment = self ._serving_api .get (deployment_instance .name )
@@ -415,10 +416,13 @@ def create(self, deployment_instance):
415
416
deployment_instance .update_from_response_json (
416
417
existing_deployment .to_dict ()
417
418
)
419
+ raise_err = False
418
420
else : # otherwise, raise an exception
419
421
print (", but it is serving a different model version." )
420
422
print ("Please, choose a different name." )
421
- raise re
423
+
424
+ if raise_err :
425
+ raise re
422
426
423
427
if deployment_instance .is_stopped ():
424
428
print ("Before making predictions, start the deployment by using `.start()`" )
You can’t perform that action at this time.
0 commit comments