Log exceptions in AJAX requests