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