syntax = "proto2";

package Ws;

option java_package = "org.obiba.opal.web.model";

message ClientErrorDto {
  required int32 code = 1; // Holds the HTTP status code (4xx)
  required string status = 2; // Holds a one-word error descriptor. This should be usable as a key in localisation bundles.
  repeated string arguments = 3; // Arguments to be passed during localisation
  extensions 1000 to max; // Extensions can be registered to provide additional error data on a case-by-case basis
}

message ServerErrorDto {
  required int32 code = 1; // Holds the HTTP status code (5xx)
  required string status = 2; // Holds a one-word error descriptor. This should be usable as a key in localisation bundles.
  repeated string arguments = 3; // Arguments to be passed during localisation
  extensions 1000 to max; // Extensions can be registered to provide additional error data on a case-by-case basis
}

message ConstraintViolationErrorDto {
  required string message = 1; // the interpolated error message for this constraint violation
  required string messageTemplate = 2; // the non-interpolated error message for this constraint violation
  required string propertyPath = 3;
  extend ClientErrorDto {
    repeated ConstraintViolationErrorDto errors = 1002;
  }
}