feat: handle port forward subdomain conflict

This commit is contained in:
2024-12-04 00:10:25 +00:00
parent ee857cbbf9
commit 4c41d4ce07
8 changed files with 81 additions and 7 deletions

View File

@@ -126,6 +126,10 @@ func updateWorkspace(c echo.Context, workspace *workspace) error {
if len(body.PortMappings) > 0 {
if err = mgr.addPortMappings(ctx, workspace, body.PortMappings); err != nil {
var errPortMappingConflicts *errPortMappingConflicts
if errors.As(err, &errPortMappingConflicts) {
return apierror.New(http.StatusConflict, "PORT_MAPPINGS_EXIST", err.Error())
}
return err
}
}