Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bindings error enum not showing message or docs #1364

Conversation

BlaineHeffron
Copy link
Contributor

What

Fixes #1346

Why

Bindings genered from something like this:

/// Represents the different kinds of errors that can occur in the application.
pub enum Error {
    /// The requested item was not found.
    NotFound = 1,
    
    /// The operation was not permitted.
    NotPermitted = 2,

was showing this:

export const Errors = {
  1: {message:""},
  2: {message:""},

Now it will properly put a message and docstring:

/**
 * Represents the different kinds of errors that can occur in the application.
 */
export const Errors = {
  /**
   * The requested item was not found.
   * / 
  1: {message:"NotFound"},

  /**
   * The operation was not permitted.
   * / 
  2: {message:"NotPermitted"},

Known limitations

none

@leighmcculloch
Copy link
Member

leighmcculloch commented Jun 7, 2024

Looks like a test / lint is failing. Could you push a fix?

@BlaineHeffron
Copy link
Contributor Author

Fixed, now it just looks like unrelated tests are failing.

Copy link
Contributor

@chadoh chadoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the cleanup to the indent logic, too! 👏🏼

@BlaineHeffron BlaineHeffron force-pushed the fix/bindings-error-enum-message-comments branch from 9a59dba to cc7797a Compare June 10, 2024 20:04
@BlaineHeffron BlaineHeffron force-pushed the fix/bindings-error-enum-message-comments branch from cc7797a to 173a627 Compare June 11, 2024 20:11
@chadoh chadoh enabled auto-merge June 11, 2024 20:18
auto-merge was automatically disabled July 8, 2024 14:05

Merge commits are not allowed on this repository

@willemneal willemneal merged commit 40a1f1e into stellar:main Jul 8, 2024
24 checks passed
@BlaineHeffron BlaineHeffron deleted the fix/bindings-error-enum-message-comments branch July 8, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Binding generated errors don't include the error name in their generated message
4 participants