1 | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved. |
2 | |
3 | Licensed under the Apache License, Version 2.0 (the "License"); |
4 | you may not use this file except in compliance with the License. |
5 | You may obtain a copy of the License at |
6 | |
7 | http://www.apache.org/licenses/LICENSE-2.0 |
8 | |
9 | Unless required by applicable law or agreed to in writing, software |
10 | distributed under the License is distributed on an "AS IS" BASIS, |
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | See the License for the specific language governing permissions and |
13 | limitations under the License. |
14 | ==============================================================================*/ |
15 | |
16 | #ifndef TENSORFLOW_CORE_PLATFORM_ERRORS_H_ |
17 | #define TENSORFLOW_CORE_PLATFORM_ERRORS_H_ |
18 | |
19 | #include <sstream> |
20 | #include <string> |
21 | #include <utility> |
22 | |
23 | #include "absl/base/attributes.h" |
24 | #include "absl/strings/str_join.h" |
25 | #include "tensorflow/core/platform/logging.h" |
26 | #include "tensorflow/core/platform/macros.h" |
27 | #include "tensorflow/core/platform/status.h" |
28 | #include "tensorflow/core/platform/str_util.h" |
29 | #include "tensorflow/core/platform/strcat.h" |
30 | #include "tensorflow/tsl/platform/errors.h" |
31 | |
32 | namespace tensorflow { |
33 | namespace errors { |
34 | |
35 | // NOLINTBEGIN(misc-unused-using-decls) |
36 | // Maps UNIX errors into a Status. |
37 | using error::OK; |
38 | using tsl::errors::Aborted; |
39 | using tsl::errors::AbortedWithPayloads; |
40 | using tsl::errors::AlreadyExists; |
41 | using tsl::errors::AlreadyExistsWithPayloads; |
42 | using tsl::errors::AppendToMessage; |
43 | using tsl::errors::Cancelled; |
44 | using tsl::errors::CancelledWithPayloads; |
45 | using tsl::errors::CopyPayloads; |
46 | using tsl::errors::Create; |
47 | using tsl::errors::CreateWithUpdatedMessage; |
48 | using tsl::errors::DataLoss; |
49 | using tsl::errors::DataLossWithPayloads; |
50 | using tsl::errors::DeadlineExceeded; |
51 | using tsl::errors::DeadlineExceededWithPayloads; |
52 | using tsl::errors::FailedPrecondition; |
53 | using tsl::errors::FailedPreconditionWithPayloads; |
54 | using tsl::errors::FormatColocationNodeForError; |
55 | using tsl::errors::FormatFunctionForError; |
56 | using tsl::errors::FormatNodeNameForError; |
57 | using tsl::errors::FormatNodeNamesForError; |
58 | using tsl::errors::FormatOriginalNodeLocationForError; |
59 | using tsl::errors::GetPayloads; |
60 | using tsl::errors::InsertPayloads; |
61 | using tsl::errors::Internal; |
62 | using tsl::errors::InternalWithPayloads; |
63 | using tsl::errors::InvalidArgument; |
64 | using tsl::errors::InvalidArgumentWithPayloads; |
65 | using tsl::errors::IOError; |
66 | using tsl::errors::IsAborted; |
67 | using tsl::errors::IsAlreadyExists; |
68 | using tsl::errors::IsCancelled; |
69 | using tsl::errors::IsDataLoss; |
70 | using tsl::errors::IsDeadlineExceeded; |
71 | using tsl::errors::IsFailedPrecondition; |
72 | using tsl::errors::IsInternal; |
73 | using tsl::errors::IsInvalidArgument; |
74 | using tsl::errors::IsNotFound; |
75 | using tsl::errors::IsOutOfRange; |
76 | using tsl::errors::IsPermissionDenied; |
77 | using tsl::errors::IsResourceExhausted; |
78 | using tsl::errors::IsUnauthenticated; |
79 | using tsl::errors::IsUnavailable; |
80 | using tsl::errors::IsUnimplemented; |
81 | using tsl::errors::IsUnknown; |
82 | using tsl::errors::NotFound; |
83 | using tsl::errors::NotFoundWithPayloads; |
84 | using tsl::errors::OutOfRange; |
85 | using tsl::errors::OutOfRangeWithPayloads; |
86 | using tsl::errors::PermissionDenied; |
87 | using tsl::errors::PermissionDeniedWithPayloads; |
88 | using tsl::errors::ReplaceErrorFromNonCommunicationOps; |
89 | using tsl::errors::ResourceExhausted; |
90 | using tsl::errors::ResourceExhaustedWithPayloads; |
91 | using tsl::errors::Unauthenticated; |
92 | using tsl::errors::UnauthenticatedWithPayloads; |
93 | using tsl::errors::Unavailable; |
94 | using tsl::errors::UnavailableWithPayloads; |
95 | using tsl::errors::Unimplemented; |
96 | using tsl::errors::UnimplementedWithPayloads; |
97 | using tsl::errors::Unknown; |
98 | using tsl::errors::UnknownPayloads; |
99 | namespace internal { |
100 | using tsl::errors::internal::PrepareForStrCat; |
101 | } |
102 | // NOLINTEND(misc-unused-using-decls) |
103 | |
104 | } // namespace errors |
105 | } // namespace tensorflow |
106 | |
107 | #endif // TENSORFLOW_CORE_PLATFORM_ERRORS_H_ |
108 | |