File size: 2,352 Bytes
429334c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package client

import (
	"errors"
	"fmt"

	"github.com/openmeterio/openmeter/pkg/models"
)

// StripeCustomerNotFoundError
var _ models.GenericError = StripeCustomerNotFoundError{}

func NewStripeCustomerNotFoundError(stripeCustomerID string) *StripeCustomerNotFoundError {
	return &StripeCustomerNotFoundError{
		err: fmt.Errorf("stripe customer %s not found", stripeCustomerID),
	}
}

func IsStripeCustomerNotFoundError(err error) bool {
	if err == nil {
		return false
	}

	var e *StripeCustomerNotFoundError

	return errors.As(err, &e)
}

type StripeCustomerNotFoundError struct {
	err error
}

func (e StripeCustomerNotFoundError) Error() string {
	return e.err.Error()
}

func (e StripeCustomerNotFoundError) Unwrap() error {
	return e.err
}

// StripePaymentMethodNotFoundError
var _ models.GenericError = StripePaymentMethodNotFoundError{}

func NewStripePaymentMethodNotFoundError(stripePaymentMethodID string) *StripePaymentMethodNotFoundError {
	return &StripePaymentMethodNotFoundError{
		err: fmt.Errorf("stripe payment method %s not found", stripePaymentMethodID),
	}
}

func IsStripePaymentMethodNotFoundError(err error) bool {
	if err == nil {
		return false
	}

	var e *StripePaymentMethodNotFoundError

	return errors.As(err, &e)
}

type StripePaymentMethodNotFoundError struct {
	err error
}

func (e StripePaymentMethodNotFoundError) Error() string {
	return e.err.Error()
}

func (e StripePaymentMethodNotFoundError) Unwrap() error {
	return e.err
}

// StripeInvoiceCustomerTaxLocationInvalid
var _ models.GenericError = StripeInvoiceCustomerTaxLocationInvalidError{}

func NewStripeInvoiceCustomerTaxLocationInvalidError(stripeInvoiceID string, stripeMessage string) *StripeInvoiceCustomerTaxLocationInvalidError {
	return &StripeInvoiceCustomerTaxLocationInvalidError{
		err: fmt.Errorf("stripe invoice %s customer tax location invalid: %s", stripeInvoiceID, stripeMessage),
	}
}

func IsStripeInvoiceCustomerTaxLocationInvalidError(err error) bool {
	if err == nil {
		return false
	}

	var e *StripeInvoiceCustomerTaxLocationInvalidError

	return errors.As(err, &e)
}

type StripeInvoiceCustomerTaxLocationInvalidError struct {
	err error
}

func (e StripeInvoiceCustomerTaxLocationInvalidError) Error() string {
	return e.err.Error()
}

func (e StripeInvoiceCustomerTaxLocationInvalidError) Unwrap() error {
	return e.err
}