-
Notifications
You must be signed in to change notification settings - Fork 221
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
adds error handling support #1100
Conversation
6971010
to
64a4c93
Compare
88f40c5
to
ade2fd1
Compare
http/java/okhttp/lib/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java
Outdated
Show resolved
Hide resolved
3bbb58d
to
b19d1ae
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b19d1ae
to
a155ac4
Compare
What is the plan for the Should I expect that the result would be : try {
const messagesResult = await client.usersById("vincent@biret365.onmicrosoft.com").mailFoldersById("Inbox").get({
select: ["displayName2", "id"]
});
console.log(`messages Folder display name ${messagesResult?.displayName}`);
} catch(err) {
console.log(`Error: ${(err as Error).message}`);
}
|
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
…ve response handler Signed-off-by: Vincent Biret <vibiret@microsoft.com>
bf84350
to
3b5f7a3
Compare
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 Looks good to me.
This should be set in the Error classes extended from APIError. That is, in the generation process. |
@baywet I am missing this conversation in the chain. Are we continuing with Error_Escaped as seen in here in the samples? |
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Co-authored-by: Nikitha Chettiar <nikithauc@gmail.com>
@nikithauc, sorry I forgot this aspect, added As per the error type it'll be console.log(`Error: ${(err as ODataError).error?.message}`); thanks to there latest changes. microsoft/OpenAPI.NET.OData#174 |
Kudos, SonarCloud Quality Gate passed! |
- lock files update for #1100 release
Summary
fixes #411
Adds error handling to kiota clients (more details on the logic being applied in the markdown document part of this PR).
I've already logged Error conversion adjustments in the conversion library to fix the last quirks (mostly hardcoded names conflicting with languages naming conventions).
All the examples below result in the following output
Selecting
displayName2
is intentional to have the service return an error.CSharp usage
Go usage
Java usage
TypeScript usage
Todo list
(this is for me, and also for other languages owners to understand how this is implemented)
TODO CSharp
TODO TypeScript
TODO Java
TODO Go
TODO global
Generation diff
microsoft/kiota-samples#498
Description being used
microsoftgraph/msgraph-sdk-powershell#1060