OVH Cloud OVH Cloud

Débogage

3 réponses
Avatar
Cyber Sinh
Bonjour à tous,

J'ai mis en place un système permettant d'envoyer par mail les infos
concernant toutes les exceptions non "catchées". Or je viens de recevoir
les 2 mails suivants :

Message :
Index 11 does not have a value.

Source :
System.Windows.Forms

Stack Trace :
at
System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetError(Int32
boundColumnIndex, Int32 columnIndex, Int32 rowIndex)
at System.Windows.Forms.DataGridViewCell.GetErrorText(Int32 rowIndex)
at
System.Windows.Forms.DataGridViewTextBoxCell.GetErrorIconBounds(Graphics
graphics, DataGridViewCellStyle cellStyle, Int32 rowIndex)
at System.Windows.Forms.DataGridViewCell.GetErrorIconBounds(Int32 rowIndex)
at
System.Windows.Forms.DataGridViewCell.UpdateCurrentMouseLocation(DataGridViewCellMouseEventArgs
e)
at
System.Windows.Forms.DataGridViewCell.OnMouseMoveInternal(DataGridViewCellMouseEventArgs
e)
at
System.Windows.Forms.DataGridView.OnCellMouseMove(DataGridViewCellMouseEventArgs
e)
at System.Windows.Forms.DataGridView.UpdateMouseEnteredCell(HitTestInfo
hti, MouseEventArgs e)
at System.Windows.Forms.DataGridView.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.DataGridView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Message :
Index was out of range. Must be non-negative and less than the size of
the collection.
Parameter name: index

Source :
mscorlib

Stack Trace :
at System.Collections.ArrayList.get_Item(Int32 index)
at
System.Windows.Forms.DataGridViewColumnCollection.DisplayInOrder(Int32
columnIndex1, Int32 columnIndex2)
at System.Windows.Forms.DataGridView.UpdateSelectedCellsBlock(Int32
anchorColumnIndex, Int32& oldEdgeColumnIndex, Int32 newEdgeColumnIndex,
Int32 anchorRowIndex, Int32& oldEdgeRowIndex, Int32 newEdgeRowIndex)
at System.Windows.Forms.DataGridView.OnCellMouseDown(HitTestInfo hti,
Boolean isShiftDown, Boolean isControlDown)
at
System.Windows.Forms.DataGridView.OnCellMouseDown(DataGridViewCellMouseEventArgs
e)
at System.Windows.Forms.DataGridView.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.DataGridView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Ce qui m'intrique dans ceux-ci, c'est que je ne retrouve aucun code de
mon cru dans la pile des appels... Dois-je en déduire que le bug
concerne la mécanique interne du DataGridView (donc que je ne peux rien
faire) ? Ou mon code peut-il être responsable indirectement de
l'exception ? Je précise qu'il n'y a pas d'InnerExcpetion (null).

Merci pour vos lumières
Cyber Sinh

3 réponses

Avatar
zoltix
Cyber Sinh wrote:
Bonjour à tous,

J'ai mis en place un système permettant d'envoyer par mail les infos
concernant toutes les exceptions non "catchées". Or je viens de recevoir
les 2 mails suivants :

Message :
Index 11 does not have a value.

Source :
System.Windows.Forms

Stack Trace :
at
System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetError(Int32
boundColumnIndex, Int32 columnIndex, Int32 rowIndex)
at System.Windows.Forms.DataGridViewCell.GetErrorText(Int32 rowIndex)
at
System.Windows.Forms.DataGridViewTextBoxCell.GetErrorIconBounds(Graphics
graphics, DataGridViewCellStyle cellStyle, Int32 rowIndex)
at System.Windows.Forms.DataGridViewCell.GetErrorIconBounds(Int32 rowIndex)
at
System.Windows.Forms.DataGridViewCell.UpdateCurrentMouseLocation(DataGridViewCellMouseEventArgs
e)
at
System.Windows.Forms.DataGridViewCell.OnMouseMoveInternal(DataGridViewCellMouseEventArgs
e)
at
System.Windows.Forms.DataGridView.OnCellMouseMove(DataGridViewCellMouseEventArgs
e)
at System.Windows.Forms.DataGridView.UpdateMouseEnteredCell(HitTestInfo
hti, MouseEventArgs e)
at System.Windows.Forms.DataGridView.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.DataGridView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Message :
Index was out of range. Must be non-negative and less than the size of
the collection.
Parameter name: index

Source :
mscorlib

Stack Trace :
at System.Collections.ArrayList.get_Item(Int32 index)
at
System.Windows.Forms.DataGridViewColumnCollection.DisplayInOrder(Int32
columnIndex1, Int32 columnIndex2)
at System.Windows.Forms.DataGridView.UpdateSelectedCellsBlock(Int32
anchorColumnIndex, Int32& oldEdgeColumnIndex, Int32 newEdgeColumnIndex,
Int32 anchorRowIndex, Int32& oldEdgeRowIndex, Int32 newEdgeRowIndex)
at System.Windows.Forms.DataGridView.OnCellMouseDown(HitTestInfo hti,
Boolean isShiftDown, Boolean isControlDown)
at
System.Windows.Forms.DataGridView.OnCellMouseDown(DataGridViewCellMouseEventArgs
e)
at System.Windows.Forms.DataGridView.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.DataGridView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

Ce qui m'intrique dans ceux-ci, c'est que je ne retrouve aucun code de
mon cru dans la pile des appels... Dois-je en déduire que le bug
concerne la mécanique interne du DataGridView (donc que je ne peux rien
faire) ? Ou mon code peut-il être responsable indirectement de
l'exception ? Je précise qu'il n'y a pas d'InnerExcpetion (null).

Merci pour vos lumières
Cyber Sinh


J'ai déjà eu une exception similaire........... C'était du a mauvais
index. Car lorsque j'étais dans une datagrid j'utilisais une boucle
pour aller rechercher les données. ET comme mon compteur commençais a
0 et non pas 1.... j'ai eu +- le même message.
Avatar
Cyber Sinh
zoltix a écrit :
J'ai déjà eu une exception similaire........... C'était du a mauvais
index. Car lorsque j'étais dans une datagrid j'utilisais une boucle
pour aller rechercher les données. ET comme mon compteur commençais a
0 et non pas 1.... j'ai eu +- le même message.



Merci pour votre réponse mais vous ne répondez pas à mes questions.
Pourquoi aucune fonction de mon cru n'apparait dans la pile des appels ?
Comment, dans ce cas, identifier ma fonction qui génère l'excpetion ?

Merci
Avatar
Antoine Polatouche
Cyber Sinh a écrit :

Pourquoi aucune fonction de mon cru n'apparait dans la pile des appels ?
Comment, dans ce cas, identifier ma fonction qui génère l'excpetion ?



Parce que c'est une action de la souris et non pas un appel à une de vos
fonctions qui a déclenché l'exception...