// Copyright 2019 Google LLC
//
// Licensed 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.

include "fcp/tracing/tracing_schema_common.fbs";

// Keep in sync with absl status in third_party/absl/status/status.h
enum TracingStatusCode : short {
  Ok,
  Cancelled,
  Unknown,
  InvalidArgument,
  DeadlineExceeded,
  NotFound,
  AlreadyExists,
  PermissionDenied,
  ResourceExhausted,
  FailedPrecondition,
  Aborted,
  OutOfRange,
  Unimplemented,
  Internal,
  Unavailable,
  DataLoss,
  Unauthenticated,
}

table ResultExpectError (tag: "!EXP", error) {
  expectation: string;
  file_name: string;
  line: int32;
}

table ResultExpectStatusError (tag: "STAT", error) {
  // TODO(team): Pull out status fields into status struct.
  expected_code: TracingStatusCode;
  actual_code: TracingStatusCode;
  message: string;
  file_name: string;
  line: int32;
}

table ProtoParseFailure (tag: "PRPR", error) {
  type: string;
}
