How otelsql handles error type attribution
mainWhen database operations fail, otelsql automatically populates the error.type attribute to assist in debugging. The attribution logic follows these rules:
- Standard driver errors: Specific handling for
database/sql/driver.ErrBadConn,database/sql/driver.ErrSkip, anddatabase/sql/driver.ErrRemoveArgument. - Custom errors: Uses the fully qualified type name (e.g.,
github.com/your/package.CustomError). - Built-in errors: Uses the type name (e.g.,
*errors.errorStringfor errors created viaerrors.New()).