chulkilee / ex_force

A Salesforce REST API wrapper for Elixir
https://hex.pm/packages/ex_force
MIT License
38 stars 28 forks source link

Expect query stream error case #48

Closed suranyami closed 3 years ago

suranyami commented 3 years ago

We encountered a case where a query_stream can return an :error.

For us it occurred when an SObject had fields that had been renamed since the last time we connected and we had used a query for an old field name.

We have added case statements for the possible :error return state.

Because ex_force was not expecting a {:error, something} result, it would throw a runtime exception, which would bring down the parent GenServer.

We will now be able to expect a possible :error return ourselves and handle gracefully. In our specific case, we will make a new metadata SOAP request to update the known field names for the objects we wish to query. This is a side-effect of not being able to issue SELECT * FROM something queries in Salesforce query language.

sourcelevel-bot[bot] commented 3 years ago

Hello, @suranyami! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

sourcelevel-bot[bot] commented 3 years ago

SourceLevel has finished reviewing this Pull Request and has found:

But beware that this branch is 6 commits behind the chulkilee:main branch, and a review of an up to date branch would produce more accurate results.

See more details about this review.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-2.3%) to 97.727% when pulling b948f681a90e8cde87af18984c852389d99db435 on workplacearcade:expect-query-stream-error-case into 49b26022940a504a9146ec4ce9a5b5493c7247fc on chulkilee:main.

suranyami commented 3 years ago

Closing this PR, because #50 does a better job of making the returns consistent.