Using the API endpoint api/job
When no gcode file is loaded,
Send Cancel
{
"command": "cancel"
}
Response is: (409) CONFLICT
Body of:
{
"error": "Printer is neither printing nor paused, 'cancel' command cannot be performed"
}
Send pause command:
{
"command": "pause"
}
Response is: (409) CONFLICT
Body of:
{
"error": "Printer is neither printing nor paused, 'pause' command cannot be performed"
}
Send restart command: (409) CONFLICT
Body of:
{
"command": "restart"
}
Response is: (409) CONFLICT
Body of:
{
"error": "Printer does not have an active print job or is not paused"
}
Send start command:
{
"command": "start"
}
Response is: (204) NO CONTENT
Body of:
(empty)
I am thinking this really should return a 409 CONFLICT just as the other commands do.
@foosel you made this remark and it seems to generally support my thinking.
Looking at the code, it seems to me that all of these commands should have a check to see if there is a loaded file. If not they should return a 409 with a message that states the conflict type.
I wanted to discuss before attempted to make a change and submit a pull request. If my thinking is wrong, I don't want to waste everyone's time on it more than this here.