Skip to content

Commit

Permalink
homedir provided test
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurweinmann committed Jan 25, 2024
1 parent c1811cd commit 833890e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ if (typeof nmaxbrowsers !== 'number') {
if (nmaxbrowsers < 1) {
throw new Error("we need maxbrowsers to be at least 1");
}
if (typeof homedir !== 'string' || homedir.length === 0) {
throw new Error("we need a home directory degined with command line argument --homedir");
}

var browserInstances = new Array(nmaxbrowsers).fill(null);
var browserFirstPages = new Array(nmaxbrowsers).fill(null);
Expand Down Expand Up @@ -282,8 +285,8 @@ Deno.serve({ port: nport, hostname: listenon }, async (_req, _info) => {
try {
val = await wrappedReceiver[body.calls[i].methodname](...body.calls[i].parameters);
} catch (e) {
return new Response("501: we encountered the following error: " + e + " for method " + body.calls[i].methodname + " on receiver " + body.calls[i].methodreceiver, {
status: 501,
return new Response("500: we encountered the following error: " + e + " for method " + body.calls[i].methodname + " on receiver " + body.calls[i].methodreceiver, {
status: 500,
});
}
if (typeof body.calls[i].targetvarname === 'string' && body.calls[i].targetvarname.length > 0) {
Expand Down

0 comments on commit 833890e

Please sign in to comment.