Skip to content

Commit

Permalink
better and more correct logging when opening a file (#185)
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Deitcher <[email protected]>
  • Loading branch information
deitch authored Jun 12, 2023
1 parent 5eb5676 commit 22d22fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diskfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func Open(device string, opts ...OpenOpt) (*disk.Disk, error) {

f, err := os.OpenFile(device, m, 0o600)
if err != nil {
return nil, fmt.Errorf("could not open device %s exclusively for writing", device)
return nil, fmt.Errorf("could not open device %s with mode %v: %w", device, m, err)
}
// return our disk
return initDisk(f, ReadWriteExclusive, opt.sectorSize)
Expand Down

0 comments on commit 22d22fd

Please sign in to comment.