Skip to content

fix: use struct type in ApiError typespec#726

Merged
jchristgit merged 1 commit into
Kraigie:masterfrom
Sim-hu:fix/api-error-typespec
Apr 5, 2026
Merged

fix: use struct type in ApiError typespec#726
jchristgit merged 1 commit into
Kraigie:masterfrom
Sim-hu:fix/api-error-typespec

Conversation

@Sim-hu

@Sim-hu Sim-hu commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

The @type t for ApiError was defined as a plain map (%{...}) instead of a struct (%__MODULE__{...}). Since defexception creates a struct, the typespec should reflect that for accurate Dialyzer analysis.

This is consistent with how all other struct types in the codebase define their @type t (e.g., Nostrum.Struct.Emoji, Nostrum.Struct.Guild.Role).

Closes #725

The @type t for ApiError was defined as a plain map (%{...}) instead
of a struct (%__MODULE__{...}). Since defexception creates a struct,
the typespec should reflect that for accurate Dialyzer analysis.

Closes Kraigie#725
@jchristgit jchristgit self-assigned this Apr 5, 2026
@jchristgit jchristgit merged commit 03b06ba into Kraigie:master Apr 5, 2026
11 checks passed
@jchristgit

Copy link
Copy Markdown
Collaborator

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect typespec for exceptions

2 participants