Skip to content

Improve error handling in parser #119

Closed as not planned
Closed as not planned

Description

@magicmatatjahu

Reason/Context

On the Slack, there was a discussion in which several proposals were proposed to improve the handling of errors in parser.

Description

Proposals:

  1. Add custom-validation-error new error type for custom validation like: validate variables of server name etc...

  2. Create the predefinied classes for error types like in models:

class ValidationError extends ParserError {
  super(...args) {
     args.type = "validation-errors";
     super(args);
  }

  // additional logic
}
  1. Think about subtypes for custom-validation-errors, for channels, server-variables etc. It would be great if it will be implemented with HTTP Problems RFC.

NOTE: this is improvement not for 1.0.0 but for the next version.

Activity

  1. added
    enhancement
    on Jul 14, 2020
  2. changed the title [-]Improve error handling with custom error types[/-] [+]Improve error handling in parser[/+] on Jul 14, 2020
  3. derberg commented on Aug 4, 2020

    @derberg
    Member

    I'm with the idea of introducing more error types!

    I also think we need to make it super clear what is our approach to validation vs throwing errors. Should we always throw errors and have no warnings? or should we always throw errors and leave it up to the parser users to decide if a particular error type they want to silent or not.

    Why?
    This cases:

    now we are throwing errors that some Parameter or Variable object is not provided. The thing is that it is not mandatory to have those objects. Tck shows parser doesn't work as expected.

    We might need to maybe introduce some kind of strict flag and throw such special error only if strict: true

  4. derberg commented on Aug 18, 2020

    @derberg
    Member

    We discussed it during an open meeting. We had an agreement that having a kind of silent flag is good as long as it is false by default. We just did not discuss in detail what can be silent. For now, my suggestion is to use the spec as a "decision maker" here, so if something is described by the spec and is not done in the document should be a normal error, others (even if important for code gen, but not for docs) should be available for silent. But now when I think about it, silent instead of boolean could be an array of error types, that you can pass and silent 🤔 We will have to make a good proposal here when we start coding

  5. github-actions commented on Oct 18, 2020

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴
    It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
    Thank you for your contributions ❤️

  6. github-actions commented on Dec 18, 2020

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴
    It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
    Thank you for your contributions ❤️

  7. github-actions commented on Feb 20, 2021

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴
    It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
    Thank you for your contributions ❤️

  8. github-actions commented on Apr 24, 2021

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴
    It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
    Thank you for your contributions ❤️

  9. 11 remaining items

  10. magicmatatjahu commented on Dec 20, 2021

    @magicmatatjahu
    MemberAuthor

    Our js parser alone weighs something like 700-800 kbs after minification, just to remind you 😏 Running spectral as a separate tool involves validating the whole spec twice, once on the parser-js side and once on the spectral side - with medium sized specs this can be a serious problem due to memory consumption and speed. Also spectral only supports 2.0.0 version of AsyncAPI and that's another problem.

    In general, 500kb doesn't necessarily mean that it's actually added to the final bundle, because it's not the minified code but the weight of the code in the package.

  11. derberg commented on Dec 20, 2021

    @derberg
    Member

    In general, 500kb doesn't necessarily mean that it's actually added to the final bundle

    something to check for sure

    Also spectral only supports 2.0.0 version of AsyncAPI and that's another problem.

    not a problem IMHO. They keep asyncapi format in @stoplight/spectral-formats afaik and I bet they will be happy if we could support them with regular updates of the format. I think it is easier than maintaining our own linter.

    Anyway, I think we are going away from the initial goal of the issue 😄

  12. github-actions commented on Apr 20, 2022

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴

    It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

    There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

    Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

    Thank you for your patience ❤️

  13. github-actions commented on Aug 20, 2022

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴

    It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

    There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

    Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

    Thank you for your patience ❤️

  14. github-actions commented on Dec 20, 2022

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴

    It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

    There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

    Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

    Thank you for your patience ❤️

  15. magicmatatjahu commented on Dec 20, 2022

    @magicmatatjahu
    MemberAuthor

    In Parser v2 we have improved error handling, but we still need that library https://github.com/asyncapi/problem to use.

  16. github-actions commented on Jul 14, 2023

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴

    It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

    There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

    Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

    Thank you for your patience ❤️

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

    enhancementstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions