Skip to content

Undefined index in error parsing #4

Closed

Description

@petaak

In the commit: Spoje-NET/php-flexibee@7df25e9 you've changed the keys used to parse the error messages.
Original key: $responseDecoded['results'][0]['errors']
New key: $responseDecoded['results'][0]['result']

The new key does not correspond with the real response structure so I'm getting the folowing error:
ErrorException: Undefined index: result in /var/www/html/vendor/spojenet/flexibee/src/FlexiPeeHP/FlexiBeeRO.php:1081

Is it an intentional change or a mistake?

Activity

  1. Vitexus commented on Sep 9, 2020

    @Vitexus
    Collaborator

    Hallo, there is problem with response to array conversion. Could you please provide your query that produces badly parsed error response ?
    Thank you for your help

  2. self-assigned this
    on Sep 9, 2020
  3. added
    bug
    on Sep 9, 2020
  4. added a commit that references this issue on Sep 9, 2020
  5. Vitexus commented on Sep 9, 2020

    @Vitexus
    Collaborator

    Hallo Petr,
    could you please confirm that latest commit fix our issue ?

  6. petaak commented on Sep 9, 2020

    @petaak
    ContributorAuthor

    For example when I don't have permission to create an invoice I get the following response:

    {
       "winstrom":{
          "@version":"1.0",
          "success":"false",
          "stats":{
             "created":"0",
             "updated":"0",
             "deleted":"0",
             "skipped":"0",
             "failed":"1"
          },
          "results":[
             {
                "request-id":"ext:a6d87525-9fc1-4478-9b9b-dd63db1a75d3",
                "errors":[
                   {
                      "message":"Nemáte oprávnění na vytvoření záznamu v evidenci Doklady faktur. (Role uživatele: IS) [ext:a6d87525-9fc1-4478-9b9b-dd63db1a75d3]"
                   }
                ]
             }
          ]
       }
    }
    
  7. Vitexus commented on Sep 9, 2020

    @Vitexus
    Collaborator

    Ok, your problem was hotfixed. See https://github.com/Spoje-NET/php-flexibee/blob/master/src/FlexiPeeHP/FlexiBeeRW.php#L139

    We need more complex error response parser in future.
    Do you need release or you use dev-maser in your project ?

  8. petaak commented on Sep 9, 2020

    @petaak
    ContributorAuthor

    Seems to be working. Thanks for a quick fix. A release would be nice.

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions