github.com/decred/politeia@v1.4.0/politeiawww/legacy/user/pi.go (about)

     1  // Copyright (c) 2020-2021 The Decred developers
     2  // Use of this source code is governed by an ISC
     3  // license that can be found in the LICENSE file.
     4  
     5  package user
     6  
     7  // Everything defined in this file is a temporary measure until proper user
     8  // plugins have been added to politeiawww, at which point these errors will be
     9  // deprecated.
    10  
    11  const (
    12  	// PiUserPluginID is a temporary plugin ID for user functionality
    13  	// that is specific to pi.
    14  	PiUserPluginID = "piuser"
    15  
    16  	// ErrorCodeInvalid is an invalid error code.
    17  	ErrorCodeInvalid = 0
    18  
    19  	// ErrorCodeUserRegistrationNotPaid is returned when a user
    20  	// attempts to write data to politeia prior to paying their user
    21  	// registration fee.
    22  	ErrorCodeUserRegistrationNotPaid = 1
    23  
    24  	// ErrorCodeBalanceInsufficient is returned when a user attempts
    25  	// to submit a proposal but does not have a proposal credit.
    26  	ErrorCodeUserBalanceInsufficient = 2
    27  )
    28  
    29  var (
    30  	// ErrorCodes contains the human readable error codes.
    31  	ErrorCodes = map[int]string{
    32  		ErrorCodeInvalid:                 "error code invalid",
    33  		ErrorCodeUserRegistrationNotPaid: "user registration not paid",
    34  		ErrorCodeUserBalanceInsufficient: "user balance insufficient",
    35  	}
    36  )