summaryrefslogtreecommitdiff
path: root/chromium/components/cryptauth/network_request_error.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/cryptauth/network_request_error.h')
-rw-r--r--chromium/components/cryptauth/network_request_error.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/chromium/components/cryptauth/network_request_error.h b/chromium/components/cryptauth/network_request_error.h
new file mode 100644
index 00000000000..51d011fd823
--- /dev/null
+++ b/chromium/components/cryptauth/network_request_error.h
@@ -0,0 +1,41 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_CRYPTAUTH_NETWORK_REQUEST_ERROR_H_
+#define COMPONENTS_CRYPTAUTH_NETWORK_REQUEST_ERROR_H_
+
+#include <ostream>
+
+namespace cryptauth {
+
+enum class NetworkRequestError {
+ // Request could not be completed because the device is offline or has issues
+ // sending the HTTP request.
+ kOffline,
+
+ // Server endpoint could not be found.
+ kEndpointNotFound,
+
+ // Authentication error contacting back-end.
+ kAuthenticationError,
+
+ // Request was invalid.
+ kBadRequest,
+
+ // The server responded, but the response was not formatted correctly.
+ kResponseMalformed,
+
+ // Internal server error.
+ kInternalServerError,
+
+ // Unknown result.
+ kUnknown
+};
+
+std::ostream& operator<<(std::ostream& stream,
+ const NetworkRequestError& error);
+
+} // namespace cryptauth
+
+#endif // COMPONENTS_CRYPTAUTH_NETWORK_REQUEST_ERROR_H_