diff --git a/system/jlib/jerror.hpp b/system/jlib/jerror.hpp index 1ab11623d89..264c33ed3a3 100644 --- a/system/jlib/jerror.hpp +++ b/system/jlib/jerror.hpp @@ -33,6 +33,7 @@ #define JLIBERR_InternalError 6002 #define JLIBERR_CppCompileError 6003 #define JLIBERR_UnexpectedValue 6004 +#define JLIBERR_K8sServiceError 6005 //---- Text for all errors (make it easy to internationalise) --------------------------- diff --git a/system/jlib/jmisc.cpp b/system/jlib/jmisc.cpp index 994d691b1c2..6fa8e1f8e35 100644 --- a/system/jlib/jmisc.cpp +++ b/system/jlib/jmisc.cpp @@ -1084,17 +1084,17 @@ std::pair getDafileServiceFromConfig(const char *applicat VStringBuffer serviceXPath("services[@type='%s']", application); Owned dafilesrvServices = getGlobalConfigSP()->getElements(serviceXPath); if (!dafilesrvServices->first()) - throw makeStringException(-1, "dafilesrv service not defined"); + throw makeStringExceptionV(JLIBERR_K8sServiceError, "dafilesrv service '%s' not defined or disabled", application); const IPropertyTree &dafilesrv = dafilesrvServices->query(); if (!dafilesrv.getPropBool("@public")) - throw makeStringException(-1, "dafilesrv service has no public service defined"); + throw makeStringExceptionV(JLIBERR_K8sServiceError, "dafilesrv service '%s' has no public service defined", application); StringBuffer dafilesrvName; dafilesrv.getProp("@name", dafilesrvName); auto externalService = getExternalService(dafilesrvName); if (externalService.first.empty()) - throw makeStringExceptionV(-1, "dafilesrv '%s': external service not found", dafilesrvName.str()); + throw makeStringExceptionV(JLIBERR_K8sServiceError, "dafilesrv service '%s' - external service '%s' not found", application, dafilesrvName.str()); if (0 == externalService.second) - throw makeStringExceptionV(-1, "dafilesrv '%s': external service port not defined", dafilesrvName.str()); + throw makeStringExceptionV(JLIBERR_K8sServiceError, "dafilesrv service '%s' - external service '%s' port not defined", application, dafilesrvName.str()); return externalService; }