diff --git a/src/kernel/peripherals/Drive.hx b/src/kernel/peripherals/Drive.hx index 726f422..e8eae50 100644 --- a/src/kernel/peripherals/Drive.hx +++ b/src/kernel/peripherals/Drive.hx @@ -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 { + try { + this.native.setDiskLabel(label); + return null; + } catch (e: Dynamic) { + return new Error("Invalid label"); + } } public inline function hasData():Bool {