Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: proper error object passing (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkucmus authored Mar 11, 2020
1 parent 2e99da6 commit 8353492
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
33 changes: 7 additions & 26 deletions .github/workflows/deploy-preview-storefrontcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,44 +45,25 @@ jobs:
initial_status: in_progress
- run: echo ::set-env name=PULL_NUMBER::$(echo "$GITHUB_REF" | awk -F / '{print $3}')
- name: Deploy on Storefrontcloud.io
run: |
# remove when fix on cloud is done
curl -s -k https://${{ github.sha }}.shopware-pwa.preview.storefrontcloud.io > /dev/null
sleep 3
# /remove when fix on cloud is done
if curl -s -k https://${{ github.sha }}.shopware-pwa.preview.storefrontcloud.io | grep -q '<html data-n-head-ssr'; then
echo "Instance updated"
# curl -s -X GET \
# https://api.github.com/repos/DivanteLtd/shopware-pwa/issues/${{env.PULL_NUMBER}}/comments \
# -H 'Accept: application/vnd.github.shadow-cat-preview+json' | grep -B4 '\"login\": \"github-actions\[bot\]"' | grep -A1 '"issue_url":' > comments.json
# grep -Po '"id": ([0-9]+)' comments.json > ids.json
# while read p; do
# commentId=$(echo $p|grep -o '[0-9]\+')
# curl -s -X DELETE \
# https://api.github.com/repos/DivanteLtd/shopware-pwa/issues/comments/$commentId \
# -H "Authorization: token ${{ github.token }}"
# done <ids.json
else
echo "Something went wrong during the update process..."
exit 1
fi
id: deploy
uses: mkucmus/storefrontcloud-preview-deploy@master
with:
token: "${{ github.token }}"
namespace: "shopware-pwa"
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: https://${{ github.sha }}.shopware-pwa.preview.storefrontcloud.io
target_url: ${{ steps.deploy.outputs.preview_url }}
state: "success"
description: Congratulations! The deploy is done.
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Comment PR
if: success()
uses: thollander/actions-comment-pull-request@master
with:
message: ':blue_heart: Shopware-PWA successfully deployed on https://${{ github.sha }}.shopware-pwa.preview.storefrontcloud.io :ok_hand:'
message: ':blue_heart: Shopware-PWA successfully deployed on ${{ steps.deploy.outputs.preview_url }} :ok_hand:'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update deployment status (failure)
if: failure()
Expand Down
4 changes: 2 additions & 2 deletions packages/composables/__tests__/useCms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("Shopware composables", () => {
await search();
expect(page.value).toEqual(null);
expect(error.value).toBeTruthy();
expect(error.value).toStrictEqual("Something went wrong...");
expect(error.value).toStrictEqual({"message": "Something went wrong..."});
});

it("should performs search request with no or empty configuration for SearchCriteria", async () => {
Expand All @@ -64,7 +64,7 @@ describe("Shopware composables", () => {
await search("", { configuration: { associations: [] } });
expect(page.value).toEqual(null);
expect(error.value).toBeTruthy();
expect(error.value).toStrictEqual("Something went wrong...");
expect(error.value).toStrictEqual({"message": "Something went wrong..."});
});

it("should return activeCategoryId if it's included within the page object", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/composables/src/hooks/useCms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const useCms = (): any => {
vuexStore.commit("SET_PAGE", result);
} catch (e) {
const err: ClientApiError = e;
error.value = err.message;
error.value = err;
} finally {
loading.value = false;
}
Expand Down

0 comments on commit 8353492

Please sign in to comment.