diff --git a/src/PharoLauncher-CLI/PhLImagePackageCliCommand.class.st b/src/PharoLauncher-CLI/PhLImagePackageCliCommand.class.st index 513bf892..9a4eca08 100644 --- a/src/PharoLauncher-CLI/PhLImagePackageCliCommand.class.st +++ b/src/PharoLauncher-CLI/PhLImagePackageCliCommand.class.st @@ -107,7 +107,9 @@ PhLImagePackageCliCommand >> createDirectoryForImageToPack [ |aPath| aPath := self location , '/' , self image name. (self directoryAlreadyExists: aPath) ifTrue: [self raiseDirectoryAlreadyExists: aPath]. - ^ aPath asFileReference ensureCreateDirectory + ^ [aPath asFileReference ensureCreateDirectory] + on: PrimitiveFailed + do: [ self raiseCannotCreateDirectory: self location] ] { #category : #private } @@ -208,6 +210,12 @@ PhLImagePackageCliCommand >> location [ ^ self positional: #location ] +{ #category : #'error signalling' } +PhLImagePackageCliCommand >> raiseCannotCreateDirectory: aPath [ + + ^PhLCommandError signal: ('Cannot write to target directory: ''{1}'', please check write permissions.' format: { aPath }) +] + { #category : #'error signalling' } PhLImagePackageCliCommand >> raiseDirectoryAlreadyExists: aPath [