Ignore:
Timestamp:
11/20/12 19:57:27 (12 years ago)
Author:
tbretz
Message:
Implemenetd a way to just check if a server is available and command descriptions have been received.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r14672 r14674  
    217217    string command = *str;
    218218
     219    if (command.length()==0)
     220        return ThrowException(String::New("Server name empty."));
     221
     222    if (args.Length()==0)
     223    {
     224        if (command.find_first_of('/')==string::npos)
     225            command += "/";
     226    }
     227
    219228    // Escape all string arguments. All others can be kept as they are.
    220229    for (int i=1; i<args.Length(); i++)
     
    233242    }
    234243
    235     return Boolean::New(JsSend(command));
     244    try
     245    {
     246        return Boolean::New(JsSend(command));
     247    }
     248    catch (const runtime_error &e)
     249    {
     250        return ThrowException(String::New(e.what()));
     251    }
     252
    236253}
    237254
Note: See TracChangeset for help on using the changeset viewer.