Skip to content

DB Adapter error handler #3569

Open
Open

Description

@DaddyWarbucks

For both the Knex and MongoDB adapters, the error handling should be more customizable. Right now both adapters import an errorHandler from another file. This makes it difficult to customize errors because we have to override each method to do so. Instead, both classes should be updated with a handleError and use that. Then the user could extend the class and only overwrite one method to customize error handler for all the other methods.

Activity

  1. daffl commented on Feb 20, 2025

    @daffl
    Member

    Good point, that would be a fairly easy non-breaking change.

    I'm still a bit on the fence about what to do with the adapters in general. In most projects I'm now just using either Kysely or just plain SQL directly. With LLMs being quite good at SQL (and MongoDB) queries it feels like all those abstractions on top of it have become a lot less useful.

    There still is the Wings initiative at https://github.com/feathersdev/wings which aimed at making the adapters Feathers independent (and using those in your services) but I'm not sure if it makes sense as a long-term project anymore.

  2. DaddyWarbucks commented on Feb 20, 2025

    @DaddyWarbucks
    MemberAuthor

    I actually just opened a PR for this update to feathers-sequelize also. I had noticed some errors that came straight from Sequelize that contain more DB info than I am comfortable sharing with the client. I will get around to opening PR's for these two libraries.

    I would love to move away from Sequelize for my main project...I am jumping through more hoops than I am using features. Drizzle interests me because you get a basic CRUD interface with it.

    I am a fan of Wings. If I were building an app in Express or Koa I would definitely reach for it. Me being a Feathers insider, I would currently reach for the classes directly and use them even outside of a Feathers app. So having Wings makes sense to me.

    I think there should always be a SQL and Mongo adapter closely coupled with Feathers. Whether that be in core or Wings, I think its important there is some "official" adapter for those two. It just makes newbies feel safe and encourages "best practices". I wouldn't want to recreate my SQL/Mongo adapter every project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions