Home | History | Annotate | Download | only in base
      1 // Copyright (c) 2006-2008 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 #include "net/base/net_errors.h"
      6 
      7 #include "base/basictypes.h"
      8 
      9 #define STRINGIZE(x) #x
     10 
     11 namespace net {
     12 
     13 const char kErrorDomain[] = "net";
     14 
     15 const char* ErrorToString(int error) {
     16   if (error == 0)
     17     return "net::OK";
     18 
     19   switch (error) {
     20 #define NET_ERROR(label, value) \
     21   case ERR_ ## label: \
     22     return "net::" STRINGIZE(ERR_ ## label);
     23 #include "net/base/net_error_list.h"
     24 #undef NET_ERROR
     25   default:
     26     return "net::<unknown>";
     27   }
     28 }
     29 
     30 }  // namespace net
     31