From 979fd8d9625170a86f057792790973d6069bc839 Mon Sep 17 00:00:00 2001 From: Eric Daniels Date: Thu, 4 Apr 2024 14:02:38 -0400 Subject: [PATCH] fix up not found error exception messages --- .../com/viam/sdk/core/exception/ModelNotFoundException.java | 2 +- .../sdk/core/exception/ResourceSubtypeNotFoundException.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/sdk/src/main/java/com/viam/sdk/core/exception/ModelNotFoundException.java b/core/sdk/src/main/java/com/viam/sdk/core/exception/ModelNotFoundException.java index e66e81ffa..b18af83d7 100644 --- a/core/sdk/src/main/java/com/viam/sdk/core/exception/ModelNotFoundException.java +++ b/core/sdk/src/main/java/com/viam/sdk/core/exception/ModelNotFoundException.java @@ -9,6 +9,6 @@ public class ModelNotFoundException extends StatusRuntimeException { public ModelNotFoundException(final Subtype subtype, final Model model) { super(Status.NOT_FOUND.withDescription( - String.format("No %s with subtype \"%s\" found in the registry", subtype, model))); + String.format("No %s with model \"%s\" found in the registry", subtype, model))); } } diff --git a/core/sdk/src/main/java/com/viam/sdk/core/exception/ResourceSubtypeNotFoundException.java b/core/sdk/src/main/java/com/viam/sdk/core/exception/ResourceSubtypeNotFoundException.java index cad511229..4c44dc896 100644 --- a/core/sdk/src/main/java/com/viam/sdk/core/exception/ResourceSubtypeNotFoundException.java +++ b/core/sdk/src/main/java/com/viam/sdk/core/exception/ResourceSubtypeNotFoundException.java @@ -8,7 +8,9 @@ public class ResourceSubtypeNotFoundException extends StatusRuntimeException { public ResourceSubtypeNotFoundException(final Subtype subtype) { super(Status.NOT_FOUND.withDescription( - String.format("No %s with subtype \"%s\" found in the registry", subtype.getResourceType(), + String.format( + "No %s with subtype \"%s\" found in the registry; did you forget to call Registry.registerSubtype?", + subtype.getResourceType(), subtype.getResourceSubtype()))); } }