-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
The GET stream method sometimes returns JSON and sometimes returns plain text. This makes it more tedious to handle responses.
If a log is not found, JSON is returned where the error property is a string: https://github.com/ProboCI/loom/blob/master/lib/api/controllers/index.js#L136
If a log is found, the plain text log is sent back:
https://github.com/ProboCI/loom/blob/master/lib/api/controllers/index.js#L153
If there is an exception or other error, JSON is returned where the error property is limited to only the exception error message:
https://github.com/ProboCI/loom/blob/master/lib/api/controllers/index.js#L19
Proposal - All responses return JSON, leaving properties empty that do not exist for the given response:
{
error: exception or null,
errorMessage: error text (placed here separately in case there is no exception object),
log: log text or empty string
}