MCPcopy Index your code
hub / github.com/apache/devlake / convertGormError

Method convertGormError

backend/impls/dalgorm/dalgorm.go:527–548  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

525}
526
527func (d *Dalgorm) convertGormError(err error) errors.Error {
528 if err == nil {
529 return nil
530 }
531 if d.IsErrorNotFound(err) {
532 return errors.NotFound.WrapRaw(err)
533 }
534 if d.IsDuplicationError(err) {
535 return errors.BadInput.WrapRaw(err)
536 }
537 if d.IsJsonOrderError(err) {
538 return errors.BadInput.WrapRaw(err)
539 }
540 if d.IsCachedPlanError(err) {
541 return nil
542 }
543 if d.IsTableExist(err) {
544 return errors.BadInput.WrapRaw(err)
545 }
546
547 return errors.Internal.WrapRaw(err)
548}

Callers 15

ExecMethod · 0.95
AutoMigrateMethod · 0.95
CursorMethod · 0.95
FetchMethod · 0.95
AllMethod · 0.95
FirstMethod · 0.95
PluckMethod · 0.95
CreateMethod · 0.95
CreateWithMapMethod · 0.95
UpdateMethod · 0.95
CreateOrUpdateMethod · 0.95
CreateIfNotExistMethod · 0.95

Calls 6

IsErrorNotFoundMethod · 0.95
IsDuplicationErrorMethod · 0.95
IsJsonOrderErrorMethod · 0.95
IsCachedPlanErrorMethod · 0.95
IsTableExistMethod · 0.95
WrapRawMethod · 0.80

Tested by

no test coverage detected