refine exception class in addMultiPorts()
authorDenis Ovsienko <denis@ovsienko.info>
Mon, 8 May 2017 09:31:11 +0000 (10:31 +0100)
committerDenis Ovsienko <denis@ovsienko.info>
Mon, 8 May 2017 12:05:51 +0000 (13:05 +0100)
The default case stands for a bug in software as the invalid input does
not come from the user. Dispatch it as such.

wwwroot/inc/ophandlers.php

index b464eab145ea9c5c1df8b8345b670d622a473ca3..bd75cf211da7811df9be239b21b55aeca4788fc0 100644 (file)
@@ -870,8 +870,7 @@ function addMultiPorts ()
                                );
                                break;
                        default:
-                               throw new InvalidRequestArgException ('format', $format);
-                               break;
+                               throw new RackTablesError ("unknown data format '${format}'", RackTablesError::INTERNAL);
                }
        }
        // Create ports, if they don't exist.