aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft')
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt40
1 files changed, 24 insertions, 16 deletions
diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index fb6b6210..17451461 100644
--- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -146,12 +146,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -190,12 +191,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -245,12 +247,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -302,12 +305,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -360,12 +364,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -420,12 +425,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -530,12 +536,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)
@@ -584,12 +591,13 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
)
)
} catch (e: Exception) {
- LOG.error(e.message, e)
+ if (!(e is ServiceException)) LOG.error(e.message, e)
ServerResponse.ok().json().bodyValueAndAwait(
mapper.writeValueAsString(
JsonRpcResponse(
id = jsonRpcRequest.id,
- error = e.message ?: "Error"
+ error = e.message ?: "Error",
+ exceptionType = e.javaClass.canonicalName
)
)
)