I'm trying to redirect to an custom url as it's coded in the below. However there might be a broken url. Therefore, I like to redirect to an second url in case of error.

**Is there any way to redirect to an second url in case of an error?**

```
        page = self.request.POST.get('ex_page')
        return redirect(page)                

```