Wpf 主窗口将显示“;发生了未处理的异常;将Usercontrol加载到选项卡项时

Wpf 主窗口将显示“;发生了未处理的异常;将Usercontrol加载到选项卡项时,wpf,binding,user-controls,wcf-binding,tabitem,Wpf,Binding,User Controls,Wcf Binding,Tabitem,在我的WPF应用程序中,每个TabItem加载不同的UserControl。在主窗口的设计视图中,当将UserControl加载到TabItem中时,会显示发生了未处理的异常,如下图所示。 XAML: 编辑:详细信息中的异常 System.NullReferenceException Object reference not set to an instance of an object. at System.Data.Linq.SqlClient.QueryConverter.VisitIn

在我的WPF应用程序中,每个
TabItem
加载不同的
UserControl
。在主窗口的设计视图中,当将
UserControl
加载到
TabItem
中时,会显示
发生了未处理的异常,如下图所示。
XAML:

编辑:详细信息中的异常

System.NullReferenceException
Object reference not set to an instance of an object.
at System.Data.Linq.SqlClient.QueryConverter.VisitInvocation(InvocationExpression invoke)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.VisitExpression(Expression exp)
at System.Data.Linq.SqlClient.QueryConverter.VisitJoin(Expression outerSequence,     Expression innerSequence, LambdaExpression outerKeySelector, LambdaExpression  innerKeySelector, LambdaExpression resultSelector)
   at     System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
 at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.VisitWhere(Expression sequence,     LambdaExpression predicate)
at  System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.VisitSelect(Expression sequence, LambdaExpression selector)
at System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.ConvertOuter(Expression node)
at System.Data.Linq.SqlClient.SqlProvider.BuildQuery(Expression query, SqlNodeAnnotations annotations)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Linq.Provider.BindingList.Create[T](DataContext context, IEnumerable`1 sequence)
at System.Data.Linq.DataQuery`1.GetNewBindingList()
at System.Data.Linq.DataQuery`1.System.ComponentModel.IListSource.GetList()
at MS.Internal.Data.ViewManager.GetViewRecord(Object collection, CollectionViewSource cvs, Type collectionViewType, Boolean createView)
at MS.Internal.Data.DataBindEngine.GetViewRecord(Object collection, CollectionViewSource key, Type collectionViewType, Boolean createView)
at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, Boolean createView)
at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, DependencyObject d)
at System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable value)
at System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
System.NullReferenceException
对象引用未设置为对象的实例。
位于System.Data.Linq.SqlClient.QueryConverter.VisitInvocation(调用表达式调用)
位于System.Data.Linq.SqlClient.QueryConverter.VisitInner(表达式节点)
位于System.Data.Linq.SqlClient.QueryConverter.VisitExpression(表达式exp)
位于System.Data.Linq.SqlClient.QueryConverter.VisitJoin(表达式outerSequence、表达式innerSequence、LambdaExpression outerKeySelector、LambdaExpression innerKeySelector、LambdaExpression resultSelector)
在System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)中
位于System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
位于System.Data.Linq.SqlClient.QueryConverter.VisitInner(表达式节点)
位于System.Data.Linq.SqlClient.QueryConverter.VisitWhere(表达式序列,LambdaExpression谓词)
在System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)中
位于System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
位于System.Data.Linq.SqlClient.QueryConverter.VisitInner(表达式节点)
位于System.Data.Linq.SqlClient.QueryConverter.VisitSelect(表达式序列,LambdaExpression选择器)
在System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)中
位于System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
位于System.Data.Linq.SqlClient.QueryConverter.VisitInner(表达式节点)
位于System.Data.Linq.SqlClient.QueryConverter.ConvertOuter(表达式节点)
位于System.Data.Linq.SqlClient.SqlProvider.BuildQuery(表达式查询、SqlNodeAnnotations注释)
位于System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(表达式查询)
位于System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
位于System.Collections.Generic.List`1..ctor(IEnumerable`1集合)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
位于System.Data.Linq.Provider.BindingList.Create[T](DataContext上下文,IEnumerable`1序列)
在System.Data.Linq.DataQuery`1.GetNewBindingList()中
位于System.Data.Linq.DataQuery`1.System.ComponentModel.IListSource.GetList()
位于MS.Internal.Data.ViewManager.GetViewRecord(对象集合、集合视图源CV、类型集合视图类型、布尔createView)
位于MS.Internal.Data.DataBindEngine.GetViewRecord(对象集合、集合视图源键、类型集合视图类型、布尔createView)
位于System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(对象源,布尔createView)
位于System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(对象源,DependencyObject d)
位于System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable值)
在System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d,DependencyPropertyChangedEventArgs e)
位于System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
位于System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
位于System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs参数)
在System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex EntryIndex,DependencyProperty dp,PropertyMetadata,EffectiveValueEntry oldEntry,EffectiveValueEntry&newEntry,布尔强制WithDeferredReference,布尔强制WithCurrentValue,OperationType OperationType)
位于System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
位于System.Windows.Data.BindingExpressionBase.Invalidate(布尔值IsSubpertyChange)
位于System.Windows.Data.BindingExpression.TransferValue(对象newValue,布尔值IsSubpertyChange)
位于System.Windows.Data.BindingExpression.Activate(对象项)
位于System.Windows.Data.BindingExpression.AttachToContext(AttachAttmpt尝试)
位于System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(布尔lastChance)
位于MS.Internal.Data.DataBindEngine.Task.Run(布尔lastChance)
在MS.Internal.Data.DataBindEngine.Run处(对象参数)
位于MS.Internal.Data.DataBindEngine.OnLayoutUpdated(对象发送方,事件参数e)
位于System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()处
位于System.Windows.ContextLayoutManager.UpdateLayout()处
位于System.Windows.ContextLayoutManager.UpdateLayoutCallback(对象参数)
位于System.Windows.Media.MediaContext.InvokeRenderCallback.DoWork()处
在System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()中
位于System.Windows.Media.MediaContext.RenderMessageHandlerCore(对象大小调整的CompositionTarget)
位于System.Windows.Media.MediaContext.RenderMessageHandler(对象大小调整的CompositionTarget)
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、Int32 numArgs)
位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象源、委托方法、对象参数、Int32 numArgs、委托catchHandler)
在视图详细信息中,InnerException显示“null”
我找不到有什么问题。有什么建议吗?谢谢。

在visual studio中单击异常消息中的查看详细信息,以了解内部异常是什么以及发生在何处。另外,张贴您的code@arefinsami内部异常是怎么说的?(查看详细信息)您还可以尝试查看事件查看器应用程序日志用户控件如何绑定到数据?在执行连接或其他影响连接的操作时,似乎存在linq问题。
<UserControl x:Class="LibraryAutomation.UserControls.CatalogControl"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:app="clr-namespace:LibraryAutomation"
         Name="catalogControl"
         mc:Ignorable="d" Loaded="catalogControl_Loaded"
         d:DesignHeight="480" d:DesignWidth="846">
<UserControl.Resources>
    <app:CopyLeftConverter x:Key="copyLeftConverter" />
    <DataTemplate x:Key="CourseTemplate">
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding Path=CourseID}"/>
            <TextBlock Text=" : "/>
            <TextBlock Text="{Binding Path=CourseName}"/>
        </StackPanel>
    </DataTemplate>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Height="481">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="0.4*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition MinHeight="400" Height="476"></RowDefinition>
        <RowDefinition Height="4*" />
    </Grid.RowDefinitions>
    <StackPanel Height="460" Margin="0,0,241,0" Grid.ColumnSpan="2">
        <ComboBox Name="courseList" VerticalAlignment="Top" SelectionChanged="courseList_SelectionChanged" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" ItemTemplate="{StaticResource CourseTemplate}"/>
        <ListView MinHeight="400" Height="400" Name="bookList" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" KeyDown="bookList_KeyDown" KeyUp="bookList_KeyDown" MouseEnter="bookList_MouseEnter" MouseDoubleClick="bookList_MouseDoubleClick" MouseDown="bookList_MouseDoubleClick" MouseUp="bookList_MouseDoubleClick">
            <ListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn Width="auto" Header="Book ID" DisplayMemberBinding="{Binding Path=BookID}"/>
                        <GridViewColumn Width="auto" Header="Book Name" DisplayMemberBinding="{Binding Path=BookName}"/>
                        <GridViewColumn Width="auto" Header="Author" DisplayMemberBinding="{Binding Path=Author}"/>
                        <GridViewColumn Width="auto" Header="Publisher" DisplayMemberBinding="{Binding Path=Publisher}"/>
                        <GridViewColumn Width="auto" Header="Remaining Qunatity" DisplayMemberBinding="{Binding Path=QuantityLeft, Converter={StaticResource copyLeftConverter}}"/>
                        <GridViewColumn Width="auto" Header="Total Quantity" DisplayMemberBinding="{Binding Path=TotalQuantity, Converter={StaticResource copyLeftConverter}}"/>
                        </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>
        <DockPanel>
            <Button Width="150" Height="30" Margin="5" Content="New Book" Name="newBook" Click="newBook_Click" HorizontalAlignment="Center"/>
            <Button Width="150" Height="30" Margin="5" Content="Save Changes" Name="saveChanges" Click="saveChanges_Click" IsEnabled="False" HorizontalAlignment="Right"/>
        </DockPanel>
    </StackPanel>
    <StackPanel Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left">
        <Image Height="150" Width="120" Source="/LibraryAutomation;component/Images/Books.jpg"/>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">ID:</Label>
            <TextBlock Width="123" Padding="10,5" Name="previewBookId"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">Title :</Label>
            <TextBlock Padding="10,5" Name="previewBookName" HorizontalAlignment="Left" Width="103" />
        </StackPanel>
        <StackPanel Orientation="Horizontal">
             <Label Height="26" Width="auto" HorizontalAlignment="Left">Author :</Label>
             <TextBlock Padding="10,5" Name="previewAuthor" HorizontalAlignment="Left" Width="100" />
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">Publisher :</Label>
            <TextBlock Padding="10,5" Name="previewPublisher" HorizontalAlignment="Left" Width="88" />
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">ISBN :</Label>
            <TextBlock Padding="10,5" Name="previewIsbn" HorizontalAlignment="Left" Width="107" />
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">Quantity :</Label>
            <TextBlock Padding="10,5" Name="previewTotalCopy" HorizontalAlignment="Left" Width="90" />
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">Remaining:</Label>
            <TextBlock Padding="10,5" Name="previewCopyLeft" HorizontalAlignment="Left" Width="84" />
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <Label Height="26" Width="auto" HorizontalAlignment="Left">Location :</Label>
            <TextBlock Padding="10,5" Name="previewLocation" HorizontalAlignment="Left" Width="92" />
        </StackPanel>
        <Separator/>
        <Button Width="150" Height="30" Name="hireThisBook" Click="hireThisBook_Click"> Hire</Button>
        <Separator/>
        <Button Margin="10" Width="100" Height="20" Name="editThisBook" Click="editThisBook_Click"> Edit</Button>
        <Button Margin="10" Width="100" Height="20" Name="deleteThisBook" Click="deleteThisBook_Click">Delete</Button>
    </StackPanel>
</Grid>
System.NullReferenceException
Object reference not set to an instance of an object.
at System.Data.Linq.SqlClient.QueryConverter.VisitInvocation(InvocationExpression invoke)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.VisitExpression(Expression exp)
at System.Data.Linq.SqlClient.QueryConverter.VisitJoin(Expression outerSequence,     Expression innerSequence, LambdaExpression outerKeySelector, LambdaExpression  innerKeySelector, LambdaExpression resultSelector)
   at     System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
 at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.VisitWhere(Expression sequence,     LambdaExpression predicate)
at  System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.VisitSelect(Expression sequence, LambdaExpression selector)
at System.Data.Linq.SqlClient.QueryConverter.VisitSequenceOperatorCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitMethodCall(MethodCallExpression mc)
at System.Data.Linq.SqlClient.QueryConverter.VisitInner(Expression node)
at System.Data.Linq.SqlClient.QueryConverter.ConvertOuter(Expression node)
at System.Data.Linq.SqlClient.SqlProvider.BuildQuery(Expression query, SqlNodeAnnotations annotations)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Linq.Provider.BindingList.Create[T](DataContext context, IEnumerable`1 sequence)
at System.Data.Linq.DataQuery`1.GetNewBindingList()
at System.Data.Linq.DataQuery`1.System.ComponentModel.IListSource.GetList()
at MS.Internal.Data.ViewManager.GetViewRecord(Object collection, CollectionViewSource cvs, Type collectionViewType, Boolean createView)
at MS.Internal.Data.DataBindEngine.GetViewRecord(Object collection, CollectionViewSource key, Type collectionViewType, Boolean createView)
at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, Boolean createView)
at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, DependencyObject d)
at System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable value)
at System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)