@@ -51,6 +51,52 @@ qx.Class.define("osparc.Error", {
5151 }
5252 } ,
5353
54+ statics : {
55+ FRIENDLY_HTTP_STATUS : {
56+ "200" : "OK" ,
57+ "201" : "Created" ,
58+ "202" : "Accepted" ,
59+ "203" : "Non-Authoritative Information" ,
60+ "204" : "No Content" ,
61+ "205" : "Reset Content" ,
62+ "206" : "Partial Content" ,
63+ "300" : "Multiple Choices" ,
64+ "301" : "Moved Permanently" ,
65+ "302" : "Found" ,
66+ "303" : "See Other" ,
67+ "304" : "Not Modified" ,
68+ "305" : "Use Proxy" ,
69+ "306" : "Unused" ,
70+ "307" : "Temporary Redirect" ,
71+ "400" : "Bad Request" ,
72+ "401" : "Unauthorized" ,
73+ "402" : "Payment Required" ,
74+ "403" : "Forbidden" ,
75+ "404" : "Not Found" ,
76+ "405" : "Method Not Allowed" ,
77+ "406" : "Not Acceptable" ,
78+ "407" : "Proxy Authentication Required" ,
79+ "408" : "Request Timeout" ,
80+ "409" : "Conflict" ,
81+ "410" : "Gone" ,
82+ "411" : "Length Required" ,
83+ "412" : "Precondition Required" ,
84+ "413" : "Request Entry Too Large" ,
85+ "414" : "Request-URI Too Long" ,
86+ "415" : "Unsupported Media Type" ,
87+ "416" : "Requested Range Not Satisfiable" ,
88+ "417" : "Expectation Failed" ,
89+ "418" : "I'm a teapot" ,
90+ "429" : "Too Many Requests" ,
91+ "500" : "Internal Server Error" ,
92+ "501" : "Not Implemented" ,
93+ "502" : "Bad Gateway" ,
94+ "503" : "Service Unavailable" ,
95+ "504" : "Gateway Timeout" ,
96+ "505" : "HTTP Version Not Supported"
97+ }
98+ } ,
99+
54100 members : {
55101 __status : null ,
56102 __messages : null ,
@@ -76,21 +122,23 @@ qx.Class.define("osparc.Error", {
76122 control = new qx . ui . basic . Label ( ) . set ( {
77123 font : "text-18" ,
78124 alignX : "center" ,
79- width : 200
125+ rich : true ,
126+ width : 300
80127 } ) ;
81128 break ;
82129 }
83130 case "messages-layout" : {
84131 control = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 10 ) ) . set ( {
85132 alignX : "center" ,
86- maxWidth : 200
133+ maxWidth : 300
87134 } ) ;
88135 break ;
89136 }
90137 case "message" : {
91138 control = new qx . ui . basic . Label ( ) . set ( {
92139 font : "text-16" ,
93- maxWidth : 200
140+ rich : true ,
141+ width : 300
94142 } ) ;
95143 break ;
96144 }
@@ -128,7 +176,9 @@ qx.Class.define("osparc.Error", {
128176 } ,
129177
130178 _applyCode : function ( status ) {
131- this . __status . setValue ( "Error: " + status ) ;
179+ if ( status in this . self ( ) . FRIENDLY_HTTP_STATUS ) {
180+ this . __status . setValue ( "Error: " + this . self ( ) . FRIENDLY_HTTP_STATUS [ status ] ) ;
181+ }
132182 } ,
133183
134184 _applyMessages : function ( messages ) {
0 commit comments