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

Update deploy errorHandler #2108

Merged
merged 7 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Update error handling on deployment commands (#2108)

## [4.0.4] - 2023-10-17
### Fixed
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/src/controller/publish-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

import fs from 'fs';
import path from 'path';
import {ReaderFactory, IPFS_WRITE_ENDPOINT, isFileReference, validateCommonProjectManifest, mapToObject} from '@subql/common';
import {
ReaderFactory,
IPFS_WRITE_ENDPOINT,
isFileReference,
validateCommonProjectManifest,
mapToObject,
} from '@subql/common';
import {parseAlgorandProjectManifest} from '@subql/common-algorand';
import {parseCosmosProjectManifest} from '@subql/common-cosmos';
import {parseEthereumProjectManifest} from '@subql/common-ethereum';
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ export async function checkToken(authToken_ENV: string, token_path: string): Pro
}

export function errorHandle(e: any, msg: string): Error {
if (axios.isAxiosError(e) as any) {
if ((axios.isAxiosError(e) as any) && e?.response?.data) {
throw new Error(`${msg} ${e.response.data.message}`);
} else {
throw new Error(`${msg} ${e.message}`);
}

throw new Error(`${msg} ${e.message}`);
}

export function buildProjectKey(org: string, projectName: string): string {
Expand Down
1 change: 0 additions & 1 deletion packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.0.7] - 2023-10-17
### Changed
- Update with node-core 6.0.3
Expand Down
Loading