I am getting this error while changing the owner of a record by the selected user. So basically I don't want to change an owner or show a custom error message if the user do not have access or which may throw this exception. SO can anyone suggest how to check this in apex?
Salesforce lets you check record access via apex. Some good discussion is here but do check source docs as well Can I find out if the current user has access to a record without querying?