diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index b878b4ed..12e47ebc 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -7,7 +7,7 @@ on: description: URL of the REST API required: true default: https://release.openimis.org/rest/ - app_name: + cli_app_name: description: Display name of the application required: false default: Claims Manual @@ -37,18 +37,31 @@ jobs: with: java-version: 1.8 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-${{ github.event.inputs.application_id }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} + + - uses: actions/cache@v2 + with: + path: | + ~/.android + key: ${{ runner.os }}-${{ github.event.inputs.application_id }} + - name: Environment info run: | gradle --version echo url ${{ github.event.inputs.api_base_url }} - echo app name ${{ github.event.inputs.app_name }} + echo app name ${{ github.event.inputs.cli_app_name }} - name: build run: | ./gradlew assembleCliDebug --stacktrace env: API_BASE_URL: "${{ github.event.inputs.api_base_url }}" - CLI_APP_NAME: "${{ github.event.inputs.app_name }}" + CLI_APP_NAME: "${{ github.event.inputs.cli_app_name }}" CLI_APP_DIR: "${{ github.event.inputs.app_dir }}" CLI_JAVA_DIR: "${{ github.event.inputs.cli_java_dir }}" CLI_RES_DIR: "${{ github.event.inputs.cli_res_dir }}" diff --git a/claimManagement/src/main/java/org/openimis/imisclaims/ToRestApi.java b/claimManagement/src/main/java/org/openimis/imisclaims/ToRestApi.java index ef0cc776..896393f3 100644 --- a/claimManagement/src/main/java/org/openimis/imisclaims/ToRestApi.java +++ b/claimManagement/src/main/java/org/openimis/imisclaims/ToRestApi.java @@ -64,6 +64,14 @@ public HttpResponse postToRestApi(Object object, String functionName, boolean ad HttpResponse response = httpClient.execute(httpPost); int responseCode = response.getStatusLine().getStatusCode(); Log.i("HTTP_POST", uri + functionName + " - " + responseCode); + if (responseCode >= 400) { + Log.e("HTTP_POST", object.toString()); + HttpEntity entity = response.getEntity(); + if (entity != null) { + String errorPayload = EntityUtils.toString(entity); + Log.e("HTTP_POST", "error payload" + errorPayload); + } + } return response; } catch (IOException e) { e.printStackTrace();