File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,14 @@ private void AddPnPApp()
126126 // Handle the specific CSPConfig error when deploying to site collection app catalog
127127 // This is a known SharePoint service-side limitation where tenant-level script sources
128128 // are incorrectly included in site-level CSP validation
129- manager . Remove ( result , Scope ) ;
129+ try
130+ {
131+ manager . Remove ( result , Scope ) ;
132+ }
133+ catch
134+ {
135+ // If cleanup fails, continue to throw the original error message
136+ }
130137
131138 var errorMessage = "Failed to deploy the app due to a SharePoint limitation. " +
132139 "The error 'Value of: [CSPConfig] cannot exceed: [100000]' occurs when there are too many " +
@@ -140,7 +147,7 @@ private void AddPnPApp()
140147 "- https://github.com/SharePoint/sp-dev-docs/issues/10412\n " +
141148 "- https://github.com/SharePoint/sp-dev-docs/issues/10369" ;
142149
143- throw new Exception ( errorMessage , ex ) ;
150+ throw new InvalidOperationException ( errorMessage , ex ) ;
144151 }
145152 catch
146153 {
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ private void PublishPnPApp()
112112 "- https://github.com/SharePoint/sp-dev-docs/issues/10412\n " +
113113 "- https://github.com/SharePoint/sp-dev-docs/issues/10369" ;
114114
115- throw new Exception ( errorMessage , ex ) ;
115+ throw new InvalidOperationException ( errorMessage , ex ) ;
116116 }
117117 }
118118 else
You can’t perform that action at this time.
0 commit comments