// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.

syntax="proto2";
package brpc;
option java_package="com.brpc";
option java_outer_classname="BaiduRpcErrno";

enum Errno {
    // Errno caused by client
    ENOSERVICE              = 1001;  // Service not found
    ENOMETHOD               = 1002;  // Method not found
    EREQUEST                = 1003;  // Bad Request
    ERPCAUTH                = 1004;  // Unauthorized, can't be called EAUTH
                                     // directly which is defined in MACOSX
    ETOOMANYFAILS           = 1005;  // Too many sub calls failed
    EPCHANFINISH            = 1006;  // [Internal] ParallelChannel finished
    EBACKUPREQUEST          = 1007;  // Sending backup request
    ERPCTIMEDOUT            = 1008;  // RPC call is timed out
    EFAILEDSOCKET           = 1009;  // Broken socket
    EHTTP                   = 1010;  // Bad http call
    EOVERCROWDED            = 1011;  // The server is overcrowded
    ERTMPPUBLISHABLE        = 1012;  // RtmpRetryingClientStream is publishable
    ERTMPCREATESTREAM       = 1013;  // createStream was rejected by the RTMP server
    EEOF                    = 1014;  // Got EOF
    EUNUSED                 = 1015;  // The socket was not needed
    ESSL                    = 1016;  // SSL related error
    EH2RUNOUTSTREAMS        = 1017;  // The H2 socket was run out of streams
    EREJECT                 = 1018;  // The Request is rejected

    // Errno caused by server
    EINTERNAL               = 2001;  // Internal Server Error
    ERESPONSE               = 2002;  // Bad Response
    ELOGOFF                 = 2003;  // Server is stopping
    ELIMIT                  = 2004;  // Reached server's limit on resources
    ECLOSE                  = 2005;  // Close socket initiatively
    EITP                    = 2006;  // Failed Itp response
    ESHUTDOWNWRITE          = 2007;  // Shutdown write of socket

    // Errno related to RDMA (may happen at both sides)
    ERDMA                   = 3001;  // RDMA verbs error
    ERDMAMEM                = 3002;  // Memory not registered for RDMA    
}
