/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// This file contains protocol buffers that are used for error handling
package pb;

option java_package = "org.apache.hadoop.hbase.protobuf.generated";
option java_outer_classname = "ErrorHandlingProtos";
option java_generate_equals_and_hash = true;
option optimize_for = SPEED;

/**
 * Protobuf version of a java.lang.StackTraceElement
 * so we can serialize exceptions.
 */
message StackTraceElementMessage {
  optional string declaring_class = 1;
  optional string method_name = 2;
  optional string file_name = 3;
  optional int32 line_number = 4;
}

/**
 * Cause of a remote failure for a generic exception. Contains
 * all the information for a generic exception as well as
 * optional info about the error for generic info passing
 * (which should be another protobuffed class).
 */
message GenericExceptionMessage {
  optional string class_name = 1;
  optional string message = 2;
  optional bytes error_info = 3;
  repeated StackTraceElementMessage trace = 4;
}

/**
 * Exception sent across the wire when a remote task needs
 * to notify other tasks that it failed and why
 */
message ForeignExceptionMessage {
  optional string source = 1;
  optional GenericExceptionMessage generic_exception = 2;
}
