File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ export default class ReplicateClient {
2525 { defaultPollingInterval = 500 } = { }
2626 ) {
2727 if ( ! version ) {
28- throw new Error ( "version is required" ) ;
28+ throw new ReplicateError ( "version is required" ) ;
2929 }
3030
3131 if ( ! input ) {
32- throw new Error ( "input is required" ) ;
32+ throw new ReplicateError ( "input is required" ) ;
3333 }
3434
3535 let prediction = await this . createPrediction ( version , input ) ;
@@ -85,7 +85,7 @@ export default class ReplicateClient {
8585 if ( ! resp . ok ) {
8686 // TODO: Better error handling.
8787 console . error ( await resp . text ( ) ) ;
88- throw new Error ( resp . statusText ) ;
88+ throw new ReplicateError ( resp . statusText ) ;
8989 }
9090
9191 try {
@@ -107,7 +107,7 @@ export default class ReplicateClient {
107107 const result = / ^ ( G E T | P O S T ) ( \/ [ ^ \s ] + ) $ / . exec ( action ) ;
108108
109109 if ( ! result ) {
110- throw new Error ( `Invalid action: ${ action } ` ) ;
110+ throw new ReplicateError ( `Invalid action: ${ action } ` ) ;
111111 }
112112
113113 const [ , method , path ] = result ;
You can’t perform that action at this time.
0 commit comments