Message from exception in Schema add/validate
@@ -173,8 +173,8 @@ public class PinotSchemaRestletResource {
try {
SchemaUtils.validate(schema);
} catch (Exception e) {
- throw new ControllerApplicationException(LOGGER, "Invalid schema: " + schema.getSchemaName(),
- Response.Status.BAD_REQUEST, e);
+ throw new ControllerApplicationException(LOGGER,
+ "Invalid schema: " + schema.getSchemaName() + ". Reason: " + e.getMessage(), Response.Status.BAD_REQUEST, e);
}
return schema.toPrettyJsonString();
}
@@ -190,8 +190,8 @@ public class PinotSchemaRestletResource {
try {
SchemaUtils.validate(schema);
} catch (Exception e) {
- throw new ControllerApplicationException(LOGGER, "Invalid schema: " + schema.getSchemaName(),
- Response.Status.BAD_REQUEST, e);
+ throw new ControllerApplicationException(LOGGER,
+ "Invalid schema: " + schema.getSchemaName() + ". Reason: " + e.getMessage(), Response.Status.BAD_REQUEST, e);
}
return schema.toPrettyJsonString();
}
@@ -205,7 +205,8 @@ public class PinotSchemaRestletResource {
try {
SchemaUtils.validate(schema);
} catch (Exception e) {
- throw new ControllerApplicationException(LOGGER, "Cannot add invalid schema: " + schema.getSchemaName(),
+ throw new ControllerApplicationException(LOGGER,
+ "Cannot add invalid schema: " + schema.getSchemaName() + ". Reason: " + e.getMessage(),
Response.Status.BAD_REQUEST, e);
}
@@ -235,7 +236,8 @@ public class PinotSchemaRestletResource {
try {
SchemaUtils.validate(schema);
} catch (Exception e) {
- throw new ControllerApplicationException(LOGGER, "Cannot add invalid schema: " + schemaName,
+ throw new ControllerApplicationException(LOGGER,
+ "Cannot add invalid schema: " + schemaName + ". Reason: " + e.getMessage(),
Response.Status.BAD_REQUEST, e);
}
