Skip to content

ErrorMessages

// RB2 Core Connect
namespace CoreConnect.Commerce.Exceptions;
public static class ErrorReferenceCodes
{
public const string InvalidCredentials = "inv_cred";
public const string InvalidPassword = "inv_pass";
public const string InvalidAttribute = "inv_atr";
public const string InvalidToken = "inv_tk";
public const string CustomerNotFound = "cst_nf";
public const string ProfileError = "prf-err";
public const string TokenOutdated = "tk_outd";
public const string PasswordUnchanged = "pass_unch";
public const string AddressNotFound = "addr_nf";
public const string CartUpdateFailed = "cart_up_failed";
public const string AccountInactiveError = "account_inactive";
public const string TokenExpired = "token_expired";
public const string InvalidUserInfo = "inv_info";
public const string InvalidShoppingList = "_inv_shoplist";
public const string SshippingListNotFound = "shiplist_nf";
public const string InvalidData = "inv_data";
public const string OrderNotFound = "ord_nf";
public const string InvalidCart = "inv_cart";
public const string CartNotFound = "cart_nf";
public const string OrderNotCreated = "ord_nc";
public const string PaymentNotCreated = "pay_nc";
public const string StockNotAvailable = "stk_na";
public const string QuantityTooLarge = "qty_toolarge";
}
public static class ErrorMessages
{
public static readonly CommerceErrorModel CredentialsValidationError = new(code: ErrorCodes.BAD_USER_INPUT, message: "invalid credentials", referenceCode: ErrorReferenceCodes.InvalidCredentials);
public static readonly CommerceErrorModel SignInProfileError = new(code: ErrorCodes.BAD_REQUEST, message: "unable to fetch customer profile.", referenceCode: ErrorReferenceCodes.ProfileError);
public static readonly CommerceErrorModel CustomerNotFound = new(code: ErrorCodes.BAD_REQUEST, message: "unable to find customer with the provided email.", referenceCode: ErrorReferenceCodes.CustomerNotFound);
public static readonly CommerceErrorModel AttributeNotFound = new(code: ErrorCodes.BAD_REQUEST, message: "unable to get the provided attribute.", referenceCode: ErrorReferenceCodes.InvalidAttribute);
public static readonly CommerceErrorModel TokenMismatch = new(code: ErrorCodes.BAD_REQUEST, message: "unable to reset password. reset token is invalid.", referenceCode: ErrorReferenceCodes.InvalidToken);
public static readonly CommerceErrorModel TokenAlreadyUsedError = new(code: ErrorCodes.BAD_REQUEST, message: "token is now outdated", referenceCode: ErrorReferenceCodes.TokenOutdated);
public static readonly CommerceErrorModel PasswordUnchangedError = new(code: ErrorCodes.BAD_REQUEST, message: "the new password needs to be different from the old one", referenceCode: ErrorReferenceCodes.PasswordUnchanged);
public static readonly CommerceErrorModel AddressNotFound = new(code: ErrorCodes.NOT_FOUND, message: "invalid address id", referenceCode: ErrorReferenceCodes.AddressNotFound);
public static readonly CommerceErrorModel CartUpdateError = new(code: ErrorCodes.BAD_REQUEST, message: "unable to update cart", referenceCode: ErrorReferenceCodes.CartUpdateFailed);
public static readonly CommerceErrorModel AccountInactiveError = new(code: ErrorCodes.BAD_REQUEST, message: "the user account has not been activated yet", referenceCode: ErrorReferenceCodes.AccountInactiveError);
public static readonly CommerceErrorModel TokenExpired = new(code: ErrorCodes.BAD_REQUEST, message: "Token has expired.", referenceCode: ErrorReferenceCodes.TokenExpired);
public static readonly CommerceErrorModel CartNotFound = new(code: ErrorCodes.BAD_REQUEST, message: "Cart not found.", referenceCode: ErrorReferenceCodes.CartNotFound);
public static readonly CommerceErrorModel OrderNotCreated = new(code: ErrorCodes.INTERNAL_SERVER_ERROR, message: "Order not created.", referenceCode: ErrorReferenceCodes.OrderNotCreated);
public static readonly CommerceErrorModel PaymentNotCreated = new(code: ErrorCodes.INTERNAL_SERVER_ERROR, message: "Payment not created.", referenceCode: ErrorReferenceCodes.PaymentNotCreated);
}