Hi,
It is not possible to handle all the content page error in master page.
The flow of execution is first master page pageload occur then content page pageload occur and then any user control page load occur. Hence its not possible to handle all the error in master page.
The one solution you have for this.
You can handle error in global.asax file in Application_Error() method.
Below is sample code
void Application_Error(object sender, EventArgs e)
{
Exception objErr = Server.GetLastError().GetBaseException();
string err = "Error in: " + Request.Url.ToString() +
". Error Message:" + objErr.Message.ToString();
}
Hope this will help you.