File tree Expand file tree Collapse file tree 5 files changed +9
-20
lines changed Expand file tree Collapse file tree 5 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,3 @@ export * from '#src/Path'
2424export * from '#src/Route'
2525export * from '#src/String'
2626export * from '#src/Uuid'
27-
28- // Exceptions
29- export * from '#src/Exceptions/ConfigNotNormalizedException'
30- export * from '#src/Exceptions/InvalidNumberException'
31- export * from '#src/Exceptions/InvalidUuidException'
32- export * from '#src/Exceptions/NodeExecException'
33- export * from '#src/Exceptions/NotFoundFileException'
34- export * from '#src/Exceptions/NotFoundFolderException'
35- export * from '#src/Exceptions/OrdinalNanException'
36- export * from '#src/Exceptions/RecursiveConfigException'
37- export * from '#src/Exceptions/RouteMatchException'
Original file line number Diff line number Diff line change 11{
22 "name" : " @secjs/utils" ,
3- "version" : " 1.8.6 " ,
3+ "version" : " 1.8.7 " ,
44 "description" : " Utils functions and classes for Node.js" ,
55 "license" : " MIT" ,
66 "author" : " João Lenon <lenon@athenna.io>" ,
Original file line number Diff line number Diff line change 99
1010import { Exception } from '#src/Exception'
1111
12- export class NodeExecException extends Exception {
12+ export class NodeCommandException extends Exception {
1313 /**
14- * Creates a new instance of NodeExecException .
14+ * Creates a new instance of NodeCommandException .
1515 *
1616 * @param {string } command
1717 * @param {string? } stdout
1818 * @param {string? } stderr
19- * @return {NodeExecException }
19+ * @return {NodeCommandException }
2020 */
2121 constructor ( command , stdout , stderr ) {
2222 const content = `Error has occurred when executing the command "${ command } "`
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { exec as childProcessExec } from 'node:child_process'
1515
1616import { File } from '#src/File'
1717import { Options } from '#src/Options'
18- import { NodeExecException } from '#src/Exceptions/NodeExecException '
18+ import { NodeCommandException } from '#src/Exceptions/NodeCommandException '
1919
2020const exec = promisify ( childProcessExec )
2121
@@ -38,7 +38,7 @@ export class Exec {
3838 * @param {{
3939 * ignoreErrors?: boolean
4040 * }? } options
41- * @throws {NodeExecException }
41+ * @throws {NodeCommandException }
4242 * @return {Promise<{ stdout: string, stderr: string }> }
4343 */
4444 static async command ( command , options ) {
@@ -55,7 +55,7 @@ export class Exec {
5555 return { stdout : error . stdout , stderr : error . stderr }
5656 }
5757
58- throw new NodeExecException ( command , error . stdout , error . stderr )
58+ throw new NodeCommandException ( command , error . stdout , error . stderr )
5959 }
6060 }
6161
Original file line number Diff line number Diff line change 1010import { Exec } from '#src/Exec'
1111import { Path } from '#src/Path'
1212import { File } from '#src/File'
13- import { NodeExecException } from '#src/Exceptions/NodeExecException'
1413import { Folder } from '#src/Folder'
14+ import { NodeCommandException } from '#src/Exceptions/NodeCommandException'
1515
1616describe ( '\n ExecTest' , ( ) => {
1717 it ( 'should be able to sleep the code for some ms' , async ( ) => {
@@ -27,7 +27,7 @@ describe('\n ExecTest', () => {
2727 it ( 'should throw an node exec exception when command fails' , async ( ) => {
2828 const useCase = async ( ) => await Exec . command ( 'echo "error thrown" && exit 255' )
2929
30- await expect ( useCase ) . rejects . toThrow ( NodeExecException )
30+ await expect ( useCase ) . rejects . toThrow ( NodeCommandException )
3131 } )
3232
3333 it ( 'should be able to execute a command that throws errors and ignore it' , async ( ) => {
You can’t perform that action at this time.
0 commit comments