Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
When in text output mode, print an error on an invalid command...
Browse files Browse the repository at this point in the history
 * ... in JSON output mode, no response for invalid commands.
  • Loading branch information
folecr committed Apr 30, 2013
1 parent 3905879 commit 1f4121b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/js/jsb_debugger.js
Expand Up @@ -319,6 +319,10 @@ jsonResponder.commandResponse = function (commandresult) {
this.write(JSON.stringify(response));
}

jsonResponder.commandNotFound = function () {
// do nothing
}

// Plain Old Text output
var textResponder = {};

Expand Down Expand Up @@ -410,6 +414,10 @@ textResponder.commandResponse = function (commandresult) {
this.write(response);
}

textResponder.commandNotFound = function () {
_printCommandNotFound();
}

var breakpointHandler = {
hit: function (frame) {
try {
Expand Down Expand Up @@ -499,6 +507,7 @@ this.processInput = function (str, frame, script) {

if (!command_func) {
cc.log("did not find a command processor!");
dbg.responder.commandNotFound();
} else {
try {
command_return = command_func(str, frame, script);
Expand All @@ -518,6 +527,10 @@ this.processInput = function (str, frame, script) {
}
};

_printCommandNotFound = function() {
var str = "ERROR : command not found!\n";
_bufferWrite(str);
};

_printHelp = function() {
var help = "break filename:numer\tAdds a breakpoint at a given filename and line number\n" +
Expand Down

0 comments on commit 1f4121b

Please sign in to comment.