Transaction was opened in readonly mode but a write operation was attempted.
Sample using Promise.catch()
doSomeDatabaseWork().then(result => {
// Success
}).catch('ReadOnlyError', e => {
// Failed with ReadOnlyError
console.error ("ReadOnly error: " + e.message);
}).catch(Error, e => {
// Any other error derived from standard Error
console.error ("Error: " + e.message);
}).catch(e => {
// Other error such as a string was thrown
console.error (e);
});