@@ -10,7 +10,7 @@ import textTable from 'text-table';
1010import * as jsonc from 'jsonc-parser' ;
1111
1212import { createDockerParams , createLog , launch , ProvisionOptions } from './devContainers' ;
13- import { SubstitutedConfig , createContainerProperties , envListToObj , inspectDockerImage , isDockerFileConfig , SubstituteConfig , addSubstitution , findContainerAndIdLabels , getCacheFolder } from './utils' ;
13+ import { SubstitutedConfig , createContainerProperties , envListToObj , inspectDockerImage , isDockerFileConfig , SubstituteConfig , addSubstitution , findContainerAndIdLabels , getCacheFolder , runAsyncHandler } from './utils' ;
1414import { URI } from 'vscode-uri' ;
1515import { ContainerError } from '../spec-common/errors' ;
1616import { Log , LogDimensions , LogLevel , makeLog , mapLogLevel } from '../spec-utils/log' ;
@@ -168,7 +168,7 @@ function provisionOptions(y: Argv) {
168168type ProvisionArgs = UnpackArgv < ReturnType < typeof provisionOptions > > ;
169169
170170function provisionHandler ( args : ProvisionArgs ) {
171- ( async ( ) => provision ( args ) ) ( ) . catch ( console . error ) ;
171+ runAsyncHandler ( provision . bind ( null , args ) ) ;
172172}
173173
174174async function provision ( {
@@ -366,7 +366,7 @@ function setUpOptions(y: Argv) {
366366type SetUpArgs = UnpackArgv < ReturnType < typeof setUpOptions > > ;
367367
368368function setUpHandler ( args : SetUpArgs ) {
369- ( async ( ) => setUp ( args ) ) ( ) . catch ( console . error ) ;
369+ runAsyncHandler ( setUp . bind ( null , args ) ) ;
370370}
371371
372372async function setUp ( args : SetUpArgs ) {
@@ -529,7 +529,7 @@ function buildOptions(y: Argv) {
529529type BuildArgs = UnpackArgv < ReturnType < typeof buildOptions > > ;
530530
531531function buildHandler ( args : BuildArgs ) {
532- ( async ( ) => build ( args ) ) ( ) . catch ( console . error ) ;
532+ runAsyncHandler ( build . bind ( null , args ) ) ;
533533}
534534
535535async function build ( args : BuildArgs ) {
@@ -791,7 +791,7 @@ function runUserCommandsOptions(y: Argv) {
791791type RunUserCommandsArgs = UnpackArgv < ReturnType < typeof runUserCommandsOptions > > ;
792792
793793function runUserCommandsHandler ( args : RunUserCommandsArgs ) {
794- ( async ( ) => runUserCommands ( args ) ) ( ) . catch ( console . error ) ;
794+ runAsyncHandler ( runUserCommands . bind ( null , args ) ) ;
795795}
796796async function runUserCommands ( args : RunUserCommandsArgs ) {
797797 const result = await doRunUserCommands ( args ) ;
@@ -981,7 +981,7 @@ function readConfigurationOptions(y: Argv) {
981981type ReadConfigurationArgs = UnpackArgv < ReturnType < typeof readConfigurationOptions > > ;
982982
983983function readConfigurationHandler ( args : ReadConfigurationArgs ) {
984- ( async ( ) => readConfiguration ( args ) ) ( ) . catch ( console . error ) ;
984+ runAsyncHandler ( readConfiguration . bind ( null , args ) ) ;
985985}
986986
987987async function readConfiguration ( {
@@ -1117,7 +1117,7 @@ function outdatedOptions(y: Argv) {
11171117type OutdatedArgs = UnpackArgv < ReturnType < typeof outdatedOptions > > ;
11181118
11191119function outdatedHandler ( args : OutdatedArgs ) {
1120- ( async ( ) => outdated ( args ) ) ( ) . catch ( console . error ) ;
1120+ runAsyncHandler ( outdated . bind ( null , args ) ) ;
11211121}
11221122
11231123async function outdated ( {
@@ -1249,7 +1249,7 @@ function execOptions(y: Argv) {
12491249export type ExecArgs = UnpackArgv < ReturnType < typeof execOptions > > ;
12501250
12511251function execHandler ( args : ExecArgs ) {
1252- ( async ( ) => exec ( args ) ) ( ) . catch ( console . error ) ;
1252+ runAsyncHandler ( exec . bind ( null , args ) ) ;
12531253}
12541254
12551255async function exec ( args : ExecArgs ) {
0 commit comments