catch setDiskLabel error
This commit is contained in:
parent
916831743e
commit
f6c0feda4b
@ -51,8 +51,13 @@ class Drive implements IPeripheral {
|
||||
this.native.setDiskLabel();
|
||||
}
|
||||
|
||||
public inline function setDiskLabel(label: String) {
|
||||
this.native.setDiskLabel(label);
|
||||
public inline function setDiskLabel(label: String): Null<Error> {
|
||||
try {
|
||||
this.native.setDiskLabel(label);
|
||||
return null;
|
||||
} catch (e: Dynamic) {
|
||||
return new Error("Invalid label");
|
||||
}
|
||||
}
|
||||
|
||||
public inline function hasData():Bool {
|
||||
|
Loading…
Reference in New Issue
Block a user