@@ -194,20 +194,22 @@ describe("paths.mjs exports", () => {
194194 const error = Object . assign ( new Error ( "EACCES" ) , { code : "EACCES" } )
195195 const result = getErrorMessage ( error , testFile , testTargetPath )
196196 expect ( result ) . toBe (
197- "Permission denied. Check write permissions for /home/user/.config/opencode/agents" ,
197+ "Permission denied. Check write permissions for /home/user/.config/opencode/agents. Try: chmod u+w /home/user/.config/opencode/agents or run with sudo " ,
198198 )
199199 } )
200200
201201 it ( "should return operation not permitted message for EPERM error" , ( ) => {
202202 const error = Object . assign ( new Error ( "EPERM" ) , { code : "EPERM" } )
203203 const result = getErrorMessage ( error , testFile , testTargetPath )
204- expect ( result ) . toBe ( "Operation not permitted. The file may be in use or locked" )
204+ expect ( result ) . toBe (
205+ "Operation not permitted. The file may be in use or locked. Try: lsof <file> to check what process is using it" ,
206+ )
205207 } )
206208
207209 it ( "should return disk full message for ENOSPC error" , ( ) => {
208210 const error = Object . assign ( new Error ( "ENOSPC" ) , { code : "ENOSPC" } )
209211 const result = getErrorMessage ( error , testFile , testTargetPath )
210- expect ( result ) . toBe ( "Disk full. Free up space and try again" )
212+ expect ( result ) . toBe ( "Disk full. Free up space and try again. Try: df -h to check disk usage " )
211213 } )
212214
213215 it ( "should return source file not found message for ENOENT error" , ( ) => {
@@ -219,7 +221,9 @@ describe("paths.mjs exports", () => {
219221 it ( "should return read-only filesystem message for EROFS error" , ( ) => {
220222 const error = Object . assign ( new Error ( "EROFS" ) , { code : "EROFS" } )
221223 const result = getErrorMessage ( error , testFile , testTargetPath )
222- expect ( result ) . toBe ( "Read-only file system. Cannot write to target directory" )
224+ expect ( result ) . toBe (
225+ "Read-only file system. Cannot write to target directory. Try: mount -o remount,rw <device> <mountpoint>" ,
226+ )
223227 } )
224228
225229 it ( "should return too many open files message for EMFILE error" , ( ) => {
@@ -268,7 +272,9 @@ describe("paths.mjs exports", () => {
268272 const error = Object . assign ( new Error ( "EACCES" ) , { code : "EACCES" } )
269273 const deepPath = "/very/deep/nested/path/file.md"
270274 const result = getErrorMessage ( error , "file.md" , deepPath )
271- expect ( result ) . toBe ( "Permission denied. Check write permissions for /very/deep/nested/path" )
275+ expect ( result ) . toBe (
276+ "Permission denied. Check write permissions for /very/deep/nested/path. Try: chmod u+w /very/deep/nested/path or run with sudo" ,
277+ )
272278 } )
273279
274280 it ( "should return resource temporarily unavailable message for EAGAIN error" , ( ) => {
0 commit comments