1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROMEOS_SERVICES_DEVICE_SYNC_NETWORK_REQUEST_ERROR_H_ 6 #define CHROMEOS_SERVICES_DEVICE_SYNC_NETWORK_REQUEST_ERROR_H_ 7 8 #include <ostream> 9 10 namespace chromeos { 11 12 namespace device_sync { 13 14 enum class NetworkRequestError { 15 // Request could not be completed because the device is offline or has issues 16 // sending the HTTP request. 17 kOffline, 18 19 // Server endpoint could not be found. 20 kEndpointNotFound, 21 22 // Authentication error contacting back-end. 23 kAuthenticationError, 24 25 // Request was invalid. 26 kBadRequest, 27 28 // The server responded, but the response was not formatted correctly. 29 kResponseMalformed, 30 31 // Internal server error. 32 kInternalServerError, 33 34 // Unknown result. 35 kUnknown 36 }; 37 38 std::ostream& operator<<(std::ostream& stream, 39 const NetworkRequestError& error); 40 41 } // namespace device_sync 42 43 } // namespace chromeos 44 45 #endif // CHROMEOS_SERVICES_DEVICE_SYNC_NETWORK_REQUEST_ERROR_H_ 46