@@ -75,7 +75,7 @@ func (a App) DatabaseVacuum(ctx context.Context) error {
75
75
76
76
func (a App ) RuleEndpointsGet (ctx context.Context , id int64 ) (models.RuleEndpoints , error ) {
77
77
res , err := repo .RuleEndpointsGet (ctx , a .db , id )
78
- return res , checkErr (err )
78
+ return res , convertErr (err )
79
79
}
80
80
81
81
func (a App ) EnvelopeCount (ctx context.Context ) (int , error ) {
@@ -85,15 +85,15 @@ func (a App) EnvelopeCount(ctx context.Context) (int, error) {
85
85
func (a App ) RuleDelete (ctx context.Context , id int64 ) error {
86
86
r , err := repo .RuleGet (ctx , a .db , id )
87
87
if err != nil {
88
- return checkErr (err )
88
+ return convertErr (err )
89
89
}
90
90
91
91
err = rule .Delete (r )
92
92
if err != nil {
93
93
return err
94
94
}
95
95
96
- return checkErr (repo .RuleDelete (ctx , a .db , id ))
96
+ return convertErr (repo .RuleDelete (ctx , a .db , id ))
97
97
}
98
98
99
99
func (App ) RuleExpressionCheck (ctx context.Context , expression string ) error {
@@ -112,18 +112,18 @@ func (App) RuleExpressionCheck(ctx context.Context, expression string) error {
112
112
113
113
func (a App ) AttachmentGet (ctx context.Context , id int64 ) (models.Attachment , error ) {
114
114
res , err := repo .AttachmentGet (ctx , a .db , id )
115
- return res , checkErr (err )
115
+ return res , convertErr (err )
116
116
}
117
117
118
118
func (a App ) EnvelopeSend (ctx context.Context , envelopeID int64 , endpointID int64 ) error {
119
119
env , err := repo .EnvelopeGet (ctx , a .db , envelopeID )
120
120
if err != nil {
121
- return checkErr (err )
121
+ return convertErr (err )
122
122
}
123
123
124
124
endModel , err := repo .EndpointGet (ctx , a .db , endpointID )
125
125
if err != nil {
126
- return checkErr (err )
126
+ return convertErr (err )
127
127
}
128
128
129
129
end , err := a .endpointFactory .Build (endModel )
@@ -201,7 +201,7 @@ func (a App) EnvelopeCreate(ctx context.Context, dtoMsg models.DTOMessageCreate,
201
201
202
202
func (a App ) EnvelopeDelete (ctx context.Context , id int64 ) error {
203
203
if err := repo .EnvelopeDelete (ctx , a .db , id ); err != nil {
204
- return checkErr (err )
204
+ return convertErr (err )
205
205
}
206
206
207
207
a .bus .EnvelopeDeleted (ctx )
@@ -211,7 +211,7 @@ func (a App) EnvelopeDelete(ctx context.Context, id int64) error {
211
211
212
212
func (a App ) EnvelopeGet (ctx context.Context , id int64 ) (models.Envelope , error ) {
213
213
res , err := repo .EnvelopeGet (ctx , a .db , id )
214
- return res , checkErr (err )
214
+ return res , convertErr (err )
215
215
}
216
216
217
217
func (a App ) EnvelopeList (ctx context.Context , page pagination.Page , req models.DTOEnvelopeListRequest ) (models.DTOEnvelopeListResult , error ) {
@@ -233,7 +233,7 @@ func (a App) EnvelopeDrop(ctx context.Context) error {
233
233
234
234
func (a App ) MessageHTMLGet (ctx context.Context , id int64 ) (string , error ) {
235
235
res , err := repo .MessageHTMLGet (ctx , a .db , id )
236
- return res , checkErr (err )
236
+ return res , convertErr (err )
237
237
}
238
238
239
239
func (a App ) AttachmentList (ctx context.Context , page pagination.Page , req models.DTOAttachmentListRequest ) (models.DTOAttachmentListResult , error ) {
@@ -285,7 +285,7 @@ func (a App) RuleCreate(ctx context.Context, req models.DTORuleCreate) (int64, e
285
285
func (a App ) RuleUpdate (ctx context.Context , req models.DTORuleUpdate ) error {
286
286
r , err := repo .RuleGet (ctx , a .db , req .ID )
287
287
if err != nil {
288
- return checkErr (err )
288
+ return convertErr (err )
289
289
}
290
290
291
291
r , err = rule .Update (r , req )
@@ -295,13 +295,13 @@ func (a App) RuleUpdate(ctx context.Context, req models.DTORuleUpdate) error {
295
295
296
296
err = repo .RuleUpdate (ctx , a .db , r )
297
297
if err != nil {
298
- return checkErr (err )
298
+ return convertErr (err )
299
299
}
300
300
301
301
if req .Endpoints != nil {
302
302
err := repo .RuleEndpointsSet (ctx , a .db , r .ID , * req .Endpoints )
303
303
if err != nil {
304
- return checkErr (err )
304
+ return convertErr (err )
305
305
}
306
306
}
307
307
@@ -310,7 +310,7 @@ func (a App) RuleUpdate(ctx context.Context, req models.DTORuleUpdate) error {
310
310
311
311
func (a App ) RuleGet (ctx context.Context , id int64 ) (models.Rule , error ) {
312
312
res , err := repo .RuleGet (ctx , a .db , id )
313
- return res , checkErr (err )
313
+ return res , convertErr (err )
314
314
}
315
315
316
316
func (a App ) RuleList (ctx context.Context ) ([]models.Rule , error ) {
@@ -324,7 +324,7 @@ func (a App) RuleEndpointsList(ctx context.Context) ([]models.RuleEndpoints, err
324
324
func (a App ) EndpointTest (ctx context.Context , id int64 ) error {
325
325
e , err := repo .EndpointGet (ctx , a .db , id )
326
326
if err != nil {
327
- return checkErr (err )
327
+ return convertErr (err )
328
328
}
329
329
330
330
end , err := a .endpointFactory .Build (e )
0 commit comments