gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9921: improve exception error messag


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9921: improve exception error messages.
Date: Sun, 28 Dec 2008 12:47:57 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9921
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2008-12-28 12:47:57 -0700
message:
  improve exception error messages.
modified:
  libamf/buffer.cpp
=== modified file 'libamf/buffer.cpp'
--- a/libamf/buffer.cpp 2008-12-27 16:51:48 +0000
+++ b/libamf/buffer.cpp 2008-12-28 19:47:57 +0000
@@ -202,7 +202,14 @@
        std::copy(data, data + nbytes, _data.get());
        _seekptr = _data.get() + nbytes;
     } else {
-       throw GnashException("Not enough storage was allocated to hold the 
copied data!");
+       char num[12];
+       sprintf(num, "%d", nbytes);
+       string msg = "Not enough storage was allocated to hold the copied data! 
Needs ";
+       msg += num;
+       msg += " only has ";
+       sprintf(num, "%d", _nbytes);
+       msg += num;
+       throw GnashException(msg);
     }
     return *this;
 }
@@ -224,7 +231,14 @@
            std::copy(data, data + nbytes, _seekptr);
            _seekptr += nbytes;
        } else {
-           throw GnashException("Not enough storage was allocated to hold the 
appended data!");
+           char num[12];
+           string msg = "Not enough storage was allocated to hold the appended 
data! Needs ";
+           sprintf(num, "%d", nbytes);
+           msg += num;
+           msg += " only has ";
+           sprintf(num, "%d", _nbytes - allocated());
+           msg += num;
+           throw GnashException(msg);
        }
     }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]