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 @@
if (softwaretype === undefined) {\n
softwaretype = option_selected;\n
if (json[\'software-type\'][softwaretype] === undefined ) {\n
throw new Error("The sotware type is not part of the json (" + softwaretype + ")");\n
return json[\'software-type\'][softwaretype].request;\n
.push(function (parameter_json_schema_url) {\n
......@@ -482,9 +484,13 @@
.fail(function (error) {\n
var parameter_xml = \'\';\n
console.log("FAIL CALLED");\n
return g.renderFailoverTextArea(\'\', error.toString())\n
if ( g.options.parameter.parameter_hash !== undefined ) {\n
parameter_xml = atob(g.options.parameter.parameter_hash);\n
return g.renderFailoverTextArea(parameter_xml, error.toString())\n
.push(function() {\n
error = undefined;\n
return g;\n
......@@ -656,7 +662,7 @@
<key> <string>serial</string> </key>
<value> <string>941.49037.51985.358</string> </value>
<value> <string>941.49869.11230.41728</string> </value>
<key> <string>state</string> </key>
......@@ -674,7 +680,7 @@
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