mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
refactor: throw an error when removing a non-existing plugin
Related to #2
This commit is contained in:
committed by
Rainer Killinger
parent
992a0a6f2c
commit
3ea2c3b98d
@@ -14,6 +14,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {
|
||||
SCNotFoundErrorResponse,
|
||||
SCPluginAlreadyRegisteredErrorResponse,
|
||||
SCPluginMetaData,
|
||||
SCPluginRegisterRequest,
|
||||
@@ -85,11 +86,9 @@ function addPlugin(plugin: SCPluginMetaData): SCPluginRegisterResponse {
|
||||
*/
|
||||
function removePlugin(route: string): SCPluginRegisterResponse {
|
||||
if (!plugins.has(route)) {
|
||||
// TODO: throw error when plugin that is to be removed is not already registered (after @openstapps/core update)
|
||||
// throw new SCNotFoundErrorResponse(
|
||||
// isTestEnvironment,
|
||||
// );
|
||||
return {success: false};
|
||||
throw new SCNotFoundErrorResponse(
|
||||
isTestEnvironment,
|
||||
);
|
||||
}
|
||||
// remove the plugin information using its route as a key
|
||||
plugins.delete(route);
|
||||
|
||||
Reference in New Issue
Block a user