GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Empty error reported in the SDK by nikithauc · Pull Request #353 · microsoftgraph/msgraph-sdk-javascript

Conversation

@nikithauc

@nikithauc Nikitha Chettiar (nikithauc) commented Nov 10, 2020

Copy link
Copy Markdown
Contributor

#342

Problem -

  1. The issue reported states that the response was empty with a -1 status code. I was unable to reproduce this issue for "/subscriptions".

However, I was able to get an empty response when I tried the following example to set the client-

const client = MicrosoftGraph.Client.init({
	defaultVersion: "v1.0",
	debugLogging: true,
	authProvider: (done) => {
		done(null, "");
	},
});
then try client.api("/me").get().

export type AuthProviderCallback = (error: any, accessToken: string | null) => void; If the implementation
of AuthProviderCallback created by the consumer returns an empty string for an access token and the error is set null, the response by the Graph SDK is an empty one with status code as -1 which could be confusing.
2. The GraphErrorHandler takes in error parameter of type 'any' but didn't handle, say error of type 'string', correctly.

Solution in this PR -

  1. If the access token is empty and the error specified is undefined/null, create a GraphError stating that the AccessToken is needs to specified.
  2. Also, modified the GraphErrorHandler to handle any type error parameter that is passed appropriately .

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexnault reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Nikitha Chettiar (nikithauc) added 3 commits October 30, 2020 01:30
@nikithauc
custom error non error type set to Graph Error body
289f566
@nikithauc
Unit testing empty access token
d06308e
@nikithauc
Adding a comment
cd9107c
@nikithauc
Nikitha Chettiar (nikithauc) requested review from Michael Mainer (MIchaelMainer), Vincent Biret (baywet) and Mustafa Zengin (zengin) November 10, 2020 03:30
@nikithauc Nikitha Chettiar (nikithauc) changed the title Nikitha/graph clientside error Empty error reported in the SDK Nov 10, 2020
baywet
Vincent Biret (baywet) suggested changes Nov 10, 2020
View reviewed changes
Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

MIchaelMainer
Michael Mainer (MIchaelMainer) reviewed Nov 10, 2020
View reviewed changes
Comment thread src/CustomAuthenticationProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

zengin
Mustafa Zengin (zengin) reviewed Nov 11, 2020
View reviewed changes
Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Nikitha Chettiar (nikithauc) added 4 commits November 12, 2020 17:19
@nikithauc
Adding GraphClientError Class
ee778f9
@nikithauc
Adding GraphClientError Class
4c894a8
@nikithauc
Adding unit tests for graph client error class
faccdf6
@nikithauc
Merge branch 'dev' into nikitha/graph-clientside-error
cadd22e
zengin
Mustafa Zengin (zengin) previously approved these changes Nov 17, 2020
View reviewed changes
baywet
Vincent Biret (baywet) suggested changes Nov 17, 2020
View reviewed changes
Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/GraphRequest.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Nikitha Chettiar (nikithauc) added 2 commits November 17, 2020 11:32
@nikithauc
Correcting file name and changing the rawresponse condition check
d4d1db0
@nikithauc
Merge branch 'nikitha/graph-clientside-error' of https://github.com/m…
09aa804
…icrosoftgraph/msgraph-sdk-javascript into nikitha/graph-clientside-error
@nikithauc
Nikitha Chettiar (nikithauc) dismissed Mustafa Zengin (zengin)’s stale review via 09aa804 November 17, 2020 19:38
zengin
Mustafa Zengin (zengin) previously approved these changes Nov 17, 2020
View reviewed changes
Nikitha Chettiar (nikithauc) added 3 commits December 4, 2020 13:56
@nikithauc
Merge branch 'dev' into nikitha/graph-clientside-error
d0a5704
@nikithauc
adding the graph api response interface
5a39925
@nikithauc
Merge branch 'nikitha/graph-clientside-error' of https://github.com/m…
78a7dad
…icrosoftgraph/msgraph-sdk-javascript into nikitha/graph-clientside-error
@nikithauc
Nikitha Chettiar (nikithauc) dismissed Mustafa Zengin (zengin)’s stale review via 78a7dad December 21, 2020 07:39
baywet
Vincent Biret (baywet) suggested changes Dec 21, 2020
View reviewed changes
Comment thread src/GraphErrorHandler.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Nikitha Chettiar (nikithauc) added 2 commits December 21, 2020 10:56
@nikithauc
Changing param type in doc
ba5e318
@nikithauc
Merge branch 'dev' into nikitha/graph-clientside-error
386aae3
baywet
Vincent Biret (baywet) approved these changes Dec 21, 2020
View reviewed changes
@nikithauc
Nikitha Chettiar (nikithauc) merged commit 96b40bd into dev Dec 21, 2020
@nikithauc Nikitha Chettiar (nikithauc) mentioned this pull request Dec 21, 2020
Post /subscriptions does not work #342
Closed
5 tasks done
@nikithauc
Nikitha Chettiar (nikithauc) deleted the nikitha/graph-clientside-error branch March 31, 2021 23:54
@Chaosnico9000 Nico Hinken (Chaosnico9000) mentioned this pull request Oct 23, 2026
GraphError has an empty message when the error response is not Graph JSON (text/plain, HTML or empty body) #2011
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers
@MIchaelMainer Michael Mainer (MIchaelMainer) MIchaelMainer left review comments
@baywet Vincent Biret (baywet) baywet approved these changes
@zengin Mustafa Zengin (zengin) zengin left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@nikithauc @zengin @baywet @MIchaelMainer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.