Skip to content

Commit

Permalink
chore: rename to SoloError
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
  • Loading branch information
JeffreyDallas committed Sep 18, 2024
1 parent f296aa5 commit d436f42
Showing 26 changed files with 192 additions and 192 deletions.
24 changes: 12 additions & 12 deletions src/commands/account.mjs
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
'use strict'
import chalk from 'chalk'
import { BaseCommand } from './base.mjs'
import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs'
import { SoloError, IllegalArgumentError } from '../core/errors.mjs'
import { flags } from './index.mjs'
import { Listr } from 'listr2'
import * as prompts from './prompts.mjs'
@@ -112,7 +112,7 @@ export class AccountCommand extends BaseCommand {

const hbarAmount = Number.parseFloat(amount)
if (amount && isNaN(hbarAmount)) {
throw new FullstackTestingError(`The HBAR amount was invalid: ${amount}`)
throw new SoloError(`The HBAR amount was invalid: ${amount}`)

Check warning on line 115 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L115

Added line #L115 was not covered by tests
}

if (hbarAmount > 0) {
@@ -155,7 +155,7 @@ export class AccountCommand extends BaseCommand {
}

if (!await this.k8.hasNamespace(config.namespace)) {
throw new FullstackTestingError(`namespace ${config.namespace} does not exist`)
throw new SoloError(`namespace ${config.namespace} does not exist`)

Check warning on line 158 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L158

Added line #L158 was not covered by tests
}

// set config in the context for later tasks to use
@@ -227,7 +227,7 @@ export class AccountCommand extends BaseCommand {
}
self.logger.showUser(chalk.gray('Waiting for sockets to be closed....'))
if (ctx.resultTracker.rejectedCount > 0) {
throw new FullstackTestingError(`Account keys updates failed for ${ctx.resultTracker.rejectedCount} accounts.`)
throw new SoloError(`Account keys updates failed for ${ctx.resultTracker.rejectedCount} accounts.`)

Check warning on line 230 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L230

Added line #L230 was not covered by tests
}
}
}
@@ -247,7 +247,7 @@ export class AccountCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error in creating account: ${e.message}`, e)
throw new SoloError(`Error in creating account: ${e.message}`, e)

Check warning on line 250 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L250

Added line #L250 was not covered by tests
} finally {
await this.closeConnections()
}
@@ -284,7 +284,7 @@ export class AccountCommand extends BaseCommand {
}

if (!await this.k8.hasNamespace(config.namespace)) {
throw new FullstackTestingError(`namespace ${config.namespace} does not exist`)
throw new SoloError(`namespace ${config.namespace} does not exist`)

Check warning on line 287 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L287

Added line #L287 was not covered by tests
}

// set config in the context for later tasks to use
@@ -313,7 +313,7 @@ export class AccountCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error in creating account: ${e.message}`, e)
throw new SoloError(`Error in creating account: ${e.message}`, e)

Check warning on line 316 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L316

Added line #L316 was not covered by tests
} finally {
await this.closeConnections()
}
@@ -346,7 +346,7 @@ export class AccountCommand extends BaseCommand {
}

if (!await this.k8.hasNamespace(config.namespace)) {
throw new FullstackTestingError(`namespace ${config.namespace} does not exist`)
throw new SoloError(`namespace ${config.namespace} does not exist`)

Check warning on line 349 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L349

Added line #L349 was not covered by tests
}

// set config in the context for later tasks to use
@@ -367,7 +367,7 @@ export class AccountCommand extends BaseCommand {
title: 'update the account',
task: async (ctx, task) => {
if (!(await self.updateAccountInfo(ctx))) {
throw new FullstackTestingError(`An error occurred updating account ${ctx.accountInfo.accountId}`)
throw new SoloError(`An error occurred updating account ${ctx.accountInfo.accountId}`)

Check warning on line 370 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L370

Added line #L370 was not covered by tests
}
}
},
@@ -386,7 +386,7 @@ export class AccountCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error in updating account: ${e.message}`, e)
throw new SoloError(`Error in updating account: ${e.message}`, e)

Check warning on line 389 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L389

Added line #L389 was not covered by tests
} finally {
await this.closeConnections()
}
@@ -417,7 +417,7 @@ export class AccountCommand extends BaseCommand {
}

if (!await this.k8.hasNamespace(config.namespace)) {
throw new FullstackTestingError(`namespace ${config.namespace} does not exist`)
throw new SoloError(`namespace ${config.namespace} does not exist`)

Check warning on line 420 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L420

Added line #L420 was not covered by tests
}

// set config in the context for later tasks to use
@@ -443,7 +443,7 @@ export class AccountCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error in getting account info: ${e.message}`, e)
throw new SoloError(`Error in getting account info: ${e.message}`, e)

Check warning on line 446 in src/commands/account.mjs

Codecov / codecov/patch

src/commands/account.mjs#L446

Added line #L446 was not covered by tests
} finally {
await this.closeConnections()
}
8 changes: 4 additions & 4 deletions src/commands/cluster.mjs
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
'use strict'
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer'
import { Listr } from 'listr2'
import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs'
import { SoloError, IllegalArgumentError } from '../core/errors.mjs'
import * as flags from './flags.mjs'
import { BaseCommand } from './base.mjs'
import chalk from 'chalk'
@@ -151,7 +151,7 @@ export class ClusterCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError('Error on cluster setup', e)
throw new SoloError('Error on cluster setup', e)
}

return true
@@ -191,7 +191,7 @@ export class ClusterCommand extends BaseCommand {

ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.clusterSetupNamespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
if (!ctx.isChartInstalled) {
throw new FullstackTestingError('No chart found for the cluster')
throw new SoloError('No chart found for the cluster')
}
}
},
@@ -214,7 +214,7 @@ export class ClusterCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError('Error on cluster reset', e)
throw new SoloError('Error on cluster reset', e)
}

return true
6 changes: 3 additions & 3 deletions src/commands/init.mjs
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ import { BaseCommand } from './base.mjs'
import * as core from '../core/index.mjs'
import { constants } from '../core/index.mjs'
import * as fs from 'fs'
import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs'
import { SoloError, IllegalArgumentError } from '../core/errors.mjs'
import * as flags from './flags.mjs'
import chalk from 'chalk'

@@ -51,7 +51,7 @@ export class InitCommand extends BaseCommand {
})
} catch (e) {
this.logger.error(e)
throw new FullstackTestingError(`failed to create directory: ${e.message}`, e)
throw new SoloError(`failed to create directory: ${e.message}`, e)

Check warning on line 54 in src/commands/init.mjs

Codecov / codecov/patch

src/commands/init.mjs#L54

Added line #L54 was not covered by tests
}

return dirs
@@ -136,7 +136,7 @@ export class InitCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError('Error running init', e)
throw new SoloError('Error running init', e)

Check warning on line 139 in src/commands/init.mjs

Codecov / codecov/patch

src/commands/init.mjs#L139

Added line #L139 was not covered by tests
}

return true
12 changes: 6 additions & 6 deletions src/commands/mirror_node.mjs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
*/
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer'
import { Listr } from 'listr2'
import { FullstackTestingError, IllegalArgumentError, MissingArgumentError } from '../core/errors.mjs'
import { SoloError, IllegalArgumentError, MissingArgumentError } from '../core/errors.mjs'
import { constants } from '../core/index.mjs'
import { BaseCommand } from './base.mjs'
import * as flags from './flags.mjs'
@@ -136,7 +136,7 @@ export class MirrorNodeCommand extends BaseCommand {
)

if (!await self.k8.hasNamespace(ctx.config.namespace)) {
throw new FullstackTestingError(`namespace ${ctx.config.namespace} does not exist`)
throw new SoloError(`namespace ${ctx.config.namespace} does not exist`)

Check warning on line 139 in src/commands/mirror_node.mjs

Codecov / codecov/patch

src/commands/mirror_node.mjs#L139

Added line #L139 was not covered by tests
}

await self.accountManager.loadNodeClient(ctx.config.namespace)
@@ -252,7 +252,7 @@ export class MirrorNodeCommand extends BaseCommand {

const pods = await this.k8.getPodsByLabel(['app.kubernetes.io/name=postgres'])
if (pods.length === 0) {
throw new FullstackTestingError('postgres pod not found')
throw new SoloError('postgres pod not found')

Check warning on line 255 in src/commands/mirror_node.mjs

Codecov / codecov/patch

src/commands/mirror_node.mjs#L255

Added line #L255 was not covered by tests
}
const postgresPodName = pods[0].metadata.name
const postgresContainerName = 'postgresql'
@@ -287,7 +287,7 @@ export class MirrorNodeCommand extends BaseCommand {
await tasks.run()
self.logger.debug('node start has completed')
} catch (e) {
throw new FullstackTestingError(`Error starting node: ${e.message}`, e)
throw new SoloError(`Error starting node: ${e.message}`, e)

Check warning on line 290 in src/commands/mirror_node.mjs

Codecov / codecov/patch

src/commands/mirror_node.mjs#L290

Added line #L290 was not covered by tests
} finally {
await self.accountManager.close()
}
@@ -335,7 +335,7 @@ export class MirrorNodeCommand extends BaseCommand {
ctx.config.valuesArg = ' --set hedera-mirror-node.enabled=false --set hedera-explorer.enabled=false'

if (!await self.k8.hasNamespace(ctx.config.namespace)) {
throw new FullstackTestingError(`namespace ${ctx.config.namespace} does not exist`)
throw new SoloError(`namespace ${ctx.config.namespace} does not exist`)

Check warning on line 338 in src/commands/mirror_node.mjs

Codecov / codecov/patch

src/commands/mirror_node.mjs#L338

Added line #L338 was not covered by tests
}

await self.accountManager.loadNodeClient(ctx.config.namespace)
@@ -378,7 +378,7 @@ export class MirrorNodeCommand extends BaseCommand {
await tasks.run()
self.logger.debug('node start has completed')
} catch (e) {
throw new FullstackTestingError(`Error starting node: ${e.message}`, e)
throw new SoloError(`Error starting node: ${e.message}`, e)

Check warning on line 381 in src/commands/mirror_node.mjs

Codecov / codecov/patch

src/commands/mirror_node.mjs#L381

Added line #L381 was not covered by tests
} finally {
await self.accountManager.close()
}
8 changes: 4 additions & 4 deletions src/commands/network.mjs
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer'
import chalk from 'chalk'
import { Listr } from 'listr2'
import { FullstackTestingError, IllegalArgumentError, MissingArgumentError } from '../core/errors.mjs'
import { SoloError, IllegalArgumentError, MissingArgumentError } from '../core/errors.mjs'
import { BaseCommand } from './base.mjs'
import * as flags from './flags.mjs'
import { constants, Templates } from '../core/index.mjs'
@@ -463,7 +463,7 @@ export class NetworkCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error installing chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`, e)
throw new SoloError(`Error installing chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`, e)

Check warning on line 466 in src/commands/network.mjs

Codecov / codecov/patch

src/commands/network.mjs#L466

Added line #L466 was not covered by tests
}

return true
@@ -547,7 +547,7 @@ export class NetworkCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError('Error destroying network', e)
throw new SoloError('Error destroying network', e)

Check warning on line 550 in src/commands/network.mjs

Codecov / codecov/patch

src/commands/network.mjs#L550

Added line #L550 was not covered by tests
}

return true
@@ -597,7 +597,7 @@ export class NetworkCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error upgrading chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`, e)
throw new SoloError(`Error upgrading chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`, e)

Check warning on line 600 in src/commands/network.mjs

Codecov / codecov/patch

src/commands/network.mjs#L600

Added line #L600 was not covered by tests
}

return true
Loading

0 comments on commit d436f42

Please sign in to comment.