Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Error Handling

Curtis Lowder edited this page Jul 15, 2018 · 2 revisions

Error Handling

FileMissingError

Occurs when a file is not found at the expected location

zyInterface.call("missingFile","func", [5,2], {cwd: __dirname}, (err, output)=>{
	console.log(String(err)); // ZyspawnError: Missing file "missingFile"
});

FunctionMissingError

Occurs when a function is not found in the target file

zyInterface.call("knownFile","missing", [5,2], {cwd: __dirname}, (err, output)=>{
	console.log(String(err));//ZyspawnError: Missing function "missing" in file "knownFile"
});

InvalidOperationError

Occurs when zyspawn is used incorrectly

zyInterface.done(()=>{
	zyInterface.call("file","addFunc", [5,2], {cwd: __dirname}, (err, output)=>{
		console.log(String(err));//ZyspawnError: Invald operation: Calling call() after done() on ZygoteInterface
	});
});

TimeoutError

#testFile.py
def timeout():
    while True:
        pass
zyInterface.call("testFile","timeout", [], {cwd: __dirname}, (err, output)=>{
	console.log(String(err));//ZyspawnError: Timeout on: function "timeout" in file "testFile"
});

InternalZyspawnError

This error is a generic catch all only used within zyspawn. This error and its children should not be exposed to user code

PortBrokenError

The port is broken and unable to communicate with zygote

PortTimeoutError

Response not received from zygote in specified time limit: x seconds

PortParseError

Bad response format from zygote, unable to understand message

BadStateError

Occurs when a zygote-manager is in the wrong state for a method call
i.e a manager is in a departed stated, when call expects it to be in state ready