Commit f25131f8 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_web: throw a nice error if software type is not part of the software json.

Failover should be render a textarea explaining the error.
parent 3431bdcc
...@@ -451,7 +451,9 @@ ...@@ -451,7 +451,9 @@
if (softwaretype === undefined) {\n if (softwaretype === undefined) {\n
softwaretype = option_selected;\n softwaretype = option_selected;\n
}\n }\n
\n if (json[\'software-type\'][softwaretype] === undefined ) {\n
throw new Error("The sotware type is not part of the json (" + softwaretype + ")");\n
}\n
return json[\'software-type\'][softwaretype].request;\n return json[\'software-type\'][softwaretype].request;\n
})\n })\n
.push(function (parameter_json_schema_url) {\n .push(function (parameter_json_schema_url) {\n
...@@ -482,9 +484,13 @@ ...@@ -482,9 +484,13 @@
})\n })\n
\n \n
.fail(function (error) {\n .fail(function (error) {\n
var parameter_xml = \'\';\n
console.log("FAIL CALLED");\n console.log("FAIL CALLED");\n
console.log(error.stack);\n console.log(error.stack);\n
return g.renderFailoverTextArea(\'\', error.toString())\n if ( g.options.parameter.parameter_hash !== undefined ) {\n
parameter_xml = atob(g.options.parameter.parameter_hash);\n
}\n
return g.renderFailoverTextArea(parameter_xml, error.toString())\n
.push(function() {\n .push(function() {\n
error = undefined;\n error = undefined;\n
return g;\n return g;\n
...@@ -656,7 +662,7 @@ ...@@ -656,7 +662,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>941.49037.51985.358</string> </value> <value> <string>941.49869.11230.41728</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -674,7 +680,7 @@ ...@@ -674,7 +680,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1426725080.91</float> <float>1426773992.58</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment