Skip to content
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

BTD-378 Parse and Handle Errors from LRS API #11

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Ewan-Donovan
Copy link
Contributor

@Ewan-Donovan Ewan-Donovan commented Jan 15, 2025

The core idea was to handle errors from LRS by parsing them and throwing exceptions:

if (lrsResponse.isSuccessful && lrsResponseBody != null) {
  return convertLrsResponseToOurResponse(findLearnerByDemographicsRequest, lrsResponseBody)
} else {
  throw LRSException(parseError(lrsResponse.errorBody()?.string().toString()))
}

The LRS Exception is handled by the error handler with a new method

lalithanagarur and others added 12 commits January 10, 2025 13:51
* Added integration tests for the PLR resource

* KTlint fixes

* Combined mocks into single LRS mock file

* Updated readme for /plr endpoing

* Removed wildcard imports
* Added integration tests for the PLR resource

* KTlint fixes

* Combined mocks into single LRS mock file

* Updated readme for /plr endpoing

* Removed wildcard imports

* Updated responses for /plr to be human-readable

* Removed commented code
* working tests for all response types (except errors, that's a different ticket)

* wiremock addition of new response type

* lint + refactors

* OpenAPI docs

* Test Fixes

* Klint

* Cleanup

* Cleanup
* feat(*): fix failing builds by using secrets

* feat(*): format entire source code

* fix(SSLContextProviderTest): remove SSLContextProviderTest

* feat(ResponseType): remove ResponseType as it is replaced by LRSResponseType
@Ewan-Donovan Ewan-Donovan marked this pull request as ready for review January 15, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants