ArcadeDB Version:
ArcadeDB Server v24.1.1 (build 48e937e9a860ea97a7f245994a9df8bdb6af56d2/1707162918298/main)
OS and JDK Version:
Linux 6.2.0-33-generic - OpenJDK 64-Bit Server VM 17.0.9
Expected behavior
That it is consistent with the API via curl.
Actual behavior
Trying to create a type that already exists in JavaScript (fetch, NodeJS) yields a 500 error, while curl returns a JSON object explaining the problem.
Steps to reproduce
const result = await fetch('http://localhost:2480/api/v1/command/Test', {
method: 'POST',
headers: {
'Authorization': `Basic ${Buffer.from('root:password').toString('base64')}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({"language":"sql","command":"CREATE document TYPE TestType BUCKET TestBucket"}),
});
console.log(result.status);
// 500
console.log(await result.json());
// undefined
while a curl with the same parameters returns a response (either it already exists, or success)
curl -X POST http://localhost:2480/api/v1/command/Test \
-d '{"language":"sql","command":"CREATE document TYPE TestType BUCKET TestBucket"}' \
-H "Content-Type: application/json" \
--user root:password
## {"error":"Cannot execute command","detail":"Type TestType already exists","exception":"com.arcadedb.exception.CommandExecutionException"}
ArcadeDB Version:
ArcadeDB Server v24.1.1 (build 48e937e9a860ea97a7f245994a9df8bdb6af56d2/1707162918298/main)OS and JDK Version:
Linux 6.2.0-33-generic - OpenJDK 64-Bit Server VM 17.0.9Expected behavior
That it is consistent with the API via curl.
Actual behavior
Trying to create a type that already exists in JavaScript (fetch, NodeJS) yields a 500 error, while curl returns a JSON object explaining the problem.
Steps to reproduce
while a curl with the same parameters returns a response (either it already exists, or success)