Skip to content

Commit

Permalink
chore: rename to SoloError (#614)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
  • Loading branch information
JeffreyDallas authored Sep 19, 2024
1 parent f296aa5 commit 134fa55
Show file tree
Hide file tree
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
Expand Up @@ -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'
Expand Down Expand Up @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L115

Added line #L115 was not covered by tests
}

if (hbarAmount > 0) {
Expand Down Expand Up @@ -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

View check run for this annotation

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
Expand Down Expand Up @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L230

Added line #L230 was not covered by tests
}
}
}
Expand All @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L250

Added line #L250 was not covered by tests
} finally {
await this.closeConnections()
}
Expand Down Expand Up @@ -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

View check run for this annotation

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
Expand Down Expand Up @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L316

Added line #L316 was not covered by tests
} finally {
await this.closeConnections()
}
Expand Down Expand Up @@ -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

View check run for this annotation

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
Expand All @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L370

Added line #L370 was not covered by tests
}
}
},
Expand All @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L389

Added line #L389 was not covered by tests
} finally {
await this.closeConnections()
}
Expand Down Expand Up @@ -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

View check run for this annotation

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
Expand All @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/account.mjs#L446

Added line #L446 was not covered by tests
} finally {
await this.closeConnections()
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands/cluster.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')
}
}
},
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/commands/init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/init.mjs#L54

Added line #L54 was not covered by tests
}

return dirs
Expand Down Expand Up @@ -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

View check run for this annotation

Codecov / codecov/patch

src/commands/init.mjs#L139

Added line #L139 was not covered by tests
}

return true
Expand Down
12 changes: 6 additions & 6 deletions src/commands/mirror_node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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`)
}

await self.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down Expand Up @@ -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')
}
const postgresPodName = pods[0].metadata.name
const postgresContainerName = 'postgresql'
Expand Down Expand Up @@ -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)
} finally {
await self.accountManager.close()
}
Expand Down Expand Up @@ -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`)
}

await self.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down Expand Up @@ -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)
} finally {
await self.accountManager.close()
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands/network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
}

return true
Expand Down Expand Up @@ -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)
}

return true
Expand Down Expand Up @@ -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)
}

return true
Expand Down
Loading

0 comments on commit 134fa55

Please sign in to comment.