mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 773643 - Serialize Unix errors. r=froydnj
This commit is contained in:
parent
7d7c542db1
commit
f870ac5d07
@ -122,6 +122,24 @@ if (typeof Components != "undefined") {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Serialize an instance of OSError to something that can be
|
||||
* transmitted across threads (not necessarily a string).
|
||||
*/
|
||||
OSError.toMsg = function toMsg(error) {
|
||||
return {
|
||||
operation: error.operation,
|
||||
unixErrno: error.unixErrno
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Deserialize a message back to an instance of OSError
|
||||
*/
|
||||
OSError.fromMsg = function fromMsg(msg) {
|
||||
return new OSError(msg.operation, msg.unixErrno);
|
||||
};
|
||||
|
||||
exports.OS.Shared.Unix.Error = OSError;
|
||||
|
||||
// Special constants that need to be defined on all platforms
|
||||
|
Loading…
Reference in New Issue
Block a user