Skip to content

GraphError has no code and message #171

@borys-kupar

Description

@borys-kupar

Bug Report

Prerequisites

  • Can you reproduce the problem?
  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

Description

When GraphError is constructed in constructErrorFromRawResponse function it has only raw body set. That seems to be done on intention, but it's not clear what is the reason behind it.

Console Errors:

GraphError {
[1]   statusCode: 400,
[1]   code: null,
[1]   message: null,
[1]   requestId: null,
[1]   date: 2019-05-06T15:13:45.528Z,
[1]   body:
[1]    '{\r\n  "error": {\r\n    "code": "ErrorInvalidIdMalformed",\r\n    "message": "Id is malformed.",\r\n    "innerError": {\r\n      "request-id": "27cf99dc-8493-4fc0-9471-xxxxx",\r\n      "date": "2019-05-06T15:13:45"\r\n    }\r\n  }\r\n}' }

Steps to Reproduce

  1. Fetch /users/${userId}/calendars/${calendarId}/calendarView endpoint with malformed calendar id.

Expected behavior:
GraphError should have raw error parsed, and have properties code, message, requestId set.

Actual behavior: [What actually happened]
Only raw error is available, other properties are set to null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions