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

chore: rename to SoloError #614

Merged
merged 1 commit into from
Sep 19, 2024
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
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 @@

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 @@
}

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 @@
}
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 @@
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 @@
}

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 @@
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 @@
}

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 @@
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 @@
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 @@
}

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 @@
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 * 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 @@
})
} 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 @@
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 @@
)

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

View check run for this annotation

Codecov / codecov/patch

src/commands/mirror_node.mjs#L139

Added line #L139 was not covered by tests
}

await self.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down Expand Up @@ -252,7 +252,7 @@

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

View check run for this annotation

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'
Expand Down Expand Up @@ -287,7 +287,7 @@
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

View check run for this annotation

Codecov / codecov/patch

src/commands/mirror_node.mjs#L290

Added line #L290 was not covered by tests
} finally {
await self.accountManager.close()
}
Expand Down Expand Up @@ -335,7 +335,7 @@
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

View check run for this annotation

Codecov / codecov/patch

src/commands/mirror_node.mjs#L338

Added line #L338 was not covered by tests
}

await self.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down Expand Up @@ -378,7 +378,7 @@
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

View check run for this annotation

Codecov / codecov/patch

src/commands/mirror_node.mjs#L381

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

View check run for this annotation

Codecov / codecov/patch

src/commands/network.mjs#L466

Added line #L466 was not covered by tests
}

return true
Expand Down Expand Up @@ -547,7 +547,7 @@
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

View check run for this annotation

Codecov / codecov/patch

src/commands/network.mjs#L550

Added line #L550 was not covered by tests
}

return true
Expand Down Expand Up @@ -597,7 +597,7 @@
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

View check run for this annotation

Codecov / codecov/patch

src/commands/network.mjs#L600

Added line #L600 was not covered by tests
}

return true
Expand Down
Loading
Loading