denodrivers / postgres

PostgreSQL driver for Deno
https://denodrivers.github.io/postgres
MIT License
608 stars 97 forks source link

Deno v2.0 Deno.errors.PermissionDenied -> Deno.errors.NotCapable #491

Open elmeunick9 opened 2 months ago

elmeunick9 commented 2 months ago

The new version of Deno introduces some changes to the permission system, see.

Notably the introduction of Deno.errors.NotCapable breaks createParams here.

try {
    pgEnv = getPgEnv(); 
} catch (e) {
    if (e instanceof Deno.errors.PermissionDenied) {
        has_env_access = false;
    } else {
        throw e;
    }
}

I guess for backwards compatibility we should keep both?