-
Notifications
You must be signed in to change notification settings - Fork 58
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
Webexception handling, possible fix for #132 #159
Conversation
… at response body.
# Conflicts: # src/SwaggerProvider.DesignTime/Provider.SwaggerClient.fs
SwaggerProvider.Internal.SchemaReader.readSchemaPath "" filePath | ||
|> Async.RunSynchronously | ||
|
||
failwith "External definition of this path item is not supported yet" |
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.
@Thorium few questions here
- Why to use
basePath
instead ofschemaPathRaw
? I would expect that$ref
if relative to schema rather than API base path - What is point to request schema before raising exception?
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.
Sorry, with this commit was an earlier commit for the other PR #152
and with that I the failwith is still the old code, the Parsers.fs changes can be ignored.
else err.ToString() | ||
| Choice2Of2 e -> return failwith(e.ToString()) | ||
| false -> | ||
return schemaPathRaw |> IO.File.ReadAllText |
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.
if this line is inside async we can replace in by
use sr = new StreamReader(schemaPathRaw)
return! sr.ReadToEndAsync() |> Async.AwaitTask
I'll close this and redo the PR. |
Reading the response body of non-ok web-request.
This could help for #132
My request didn't actually fail, so needs testing.