A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Can license errors be detected and "caught"?

Vote:
 

Client asked an interesting question the other day: if there's a license error on the site, can we redirect to a graceful error page?

They've had MAC problems (primary problem: they keep giving us the wrong one), and they're freaked out that a licensing error can show up on the page like it does.  If they have a licensing problem, they want to display an error page.

Well, licensing errors aren't catchable. Near as I can tell, the warning is inserted through a response filter.

Is the fact that there is an error exposed anywhere in the API?  If so, I could detect that in the PageInit of a base page, and send them to an error page.  Or even just raise an exception and let .Net error handling take care of it.

#73801
Aug 10, 2013 1:22
Vote:
 

Good morning Deane,

try this.

using EPiServer.Licensing;
var licenseing = new WebApplicationLicenseCheck();
bool isValid= licenseing.IsLicenseValid;

    

#73811
Edited, Aug 10, 2013 19:24
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.