Skip to content

[fork-ffi] exceptions: errorWithName is missing from the fork #269

Closed
purescript-lua/purescript-lua-exceptions
#5

Description

@Unisay

Problem

Upstream purescript-exceptions v6.1.0 exports errorWithName :: String -> String -> Error and the fork does not, so code written against the registry package fails to compile against the fork. Found by the #186 audit's upstream diff; exceptions is otherwise foreign-for-foreign identical to upstream.

Approach

The fork models Error as a plain Lua string: error/errorWithCause return the message, name always answers "Error", and errorWithCause's cause is documented as unobservable through this binding. The minimal restoration follows the same precedent: errorWithName name msg returns msg and the name stays unobservable, documented in the FFI like the cause. If observable names turn out to matter, that is a separate decision to upgrade the whole Error representation (a table carrying name/message/cause), which touches throwException/catchException/showErrorImpl and the Lua-side error/pcall round-trip, and would be its own issue. Add a regression check, release a patch, bump the set.

Prerequisites / Relations

None blocking. Found by the #186 audit's upstream diff (closed). Ships as an exceptions fork patch release plus a package-set bump; an observable-name upgrade of the whole Error representation would be a separate issue.

Verification / Measurement

A program using errorWithName compiles against the fork, and the regression tests pin message (errorWithName n m) == m plus the documented name behaviour.

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

    area: package-setBug in a package-set fork (FFI/sources), not the compilerbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions