You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
So I will try to prepare something and incorporate this in the lib to make things easier for everybody. Meanhwile if you come up with something don't hesitate to share your solution or make a PR.
Was working on some nodemailer project this morning and I had the same problem so I went with what @MangelMaxime proposed in the mentionned issue: check if field exists using magic ? operator.
So the logic is: when we get our response, since it can be a Core.Error or a Core.Response we just check if the field reason exists in the response object. If so we can then fairly assume it's a Core.Error.
So here you go:
letdata=[0..10]|> List.map(Test.Dummy >> Test.Encode)|> List.toArray
letoptions:PouchDB.Core.BulkDocsOptions = jsOptions(fun opt ->
opt.docs <-!!data
)let!results= db.bulkDocs options
results
|> Seq.iter(fun result ->if isNull result?reason then// it's not an errorletresponse:PouchDB.Core.Response = unbox result
printfn "Response: %A" response.id
elseleterror:PouchDB.Core.Error = unbox result
printfn "Error: %A" error.reason
)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I try to evaluate the results of
bulkDocs
I get a Fable compiler error. I want to check the results of bulkDocs.Sample code (I enhanced the existing test code in CoreTests.fs with the last 5 lines of code):
You can get the full code at my fork of this repo .
Compiler error:
Am I doing wrong or is this perhaps a bug related to (dev2.0) Cannot type test any exception .
I attempted to solve the problem according to .
The text was updated successfully, but these errors were encountered: