Commit 3ab61e12 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 55143946
......@@ -451,7 +451,9 @@
if (softwaretype === undefined) {\n
softwaretype = option_selected;\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
})\n
.push(function (parameter_json_schema_url) {\n
......@@ -482,9 +484,13 @@
})\n
\n
.fail(function (error) {\n
var parameter_xml = \'\';\n
console.log("FAIL CALLED");\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
error = undefined;\n
return g;\n
......@@ -656,7 +662,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>941.49037.51985.358</string> </value>
<value> <string>941.49869.11230.41728</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -674,7 +680,7 @@
</tuple>
<state>
<tuple>
<float>1426725080.91</float>
<float>1426773992.58</float>
<string>UTC</string>
</tuple>
</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