Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101814687
ErrorObjectSerializer.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 14, 00:07
Size
400 B
Mime Type
text/x-c++
Expires
Sun, Feb 16, 00:07 (2 d)
Engine
blob
Format
Raw Data
Handle
24230922
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
ErrorObjectSerializer.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict"
;
class
ErrorObjectSerializer
{
constructor
(
Type
)
{
this
.
Type
=
Type
;
}
serialize
(
obj
,
{
write
})
{
write
(
obj
.
message
);
write
(
obj
.
stack
);
}
deserialize
({
read
})
{
const
err
=
new
this
.
Type
();
err
.
message
=
read
();
err
.
stack
=
read
();
return
err
;
}
}
module
.
exports
=
ErrorObjectSerializer
;
Event Timeline
Log In to Comment