Skip to content

Commit a4421c9

Browse files
committed
Added out of memory message.
1 parent 0750564 commit a4421c9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

SvgFileType/SvgFileType.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,17 @@ public static Document Get(Stream input)
215215
{
216216
if (p.Exception != null && !p.IsCanceled)
217217
{
218-
MessageBox.Show(p.Exception.Message);
218+
if (p.Exception.InnerExceptions != null && p.Exception.InnerExceptions.Any(exception => exception is OutOfMemoryException))
219+
{
220+
MessageBox.Show("Not enought memory to complete this operation.");
221+
}
222+
else
223+
{
224+
var innerExpection = p.Exception?.InnerException?.Message;
225+
MessageBox.Show(p.Exception.Message + ". Message:" + innerExpection);
226+
}
227+
228+
dialog.DialogResult = DialogResult.Cancel;
219229
}
220230
else
221231
{

0 commit comments

Comments
 (0)