maoyuan121 / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

GetErrors() implementation of MemoryErrorLog does not behave as expected #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the GetErrors() method of the MemoryErrorLog class does not return
the correct number of errors.  If I pass a pageIndex of 0 and a pageSize of
1 it will return the full number of errors.  You can quickly reproduce the
problem by supplying values for the page and size querystring values in
elmah.axd.

Take a look at the following line and you should see the problem: 

http://code.google.com/p/elmah/source/browse/trunk/src/Elmah/MemoryErrorLog.cs#2
43

I know it's a minor issue but just a heads up.

Original issue reported on code.google.com by JeffLin...@gmail.com on 4 May 2010 at 7:10

GoogleCodeExporter commented 9 years ago
Reproduced as follows using IronPython 2.6.1 and ELMAH 1.1:

IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30319.1
Type "help", "copyright", "credits" or "license" for more information.
>>> from System import ApplicationException
>>> from System.Collections import ArrayList
>>> import clr
>>> clr.AddReference('Elmah')
>>> from Elmah import MemoryErrorLog, Error
>>> log = MemoryErrorLog()
>>> log.Log(Error(ApplicationException('1st error.')))
'0b886268-2001-4a28-a1e9-d92590da1ee2'
>>> log.Log(Error(ApplicationException('2nd error.')))
'28ce1caa-cc8f-47d2-93bb-9e025d34e3ff'
>>> log.Log(Error(ApplicationException('3rd error.')))
'cc43d8ec-566b-4b7b-8310-e188d7c9d423'
>>> errors = ArrayList()
>>> total = log.GetErrors(0, 1, errors)
>>> print total
3
>>> print errors.Count
3

The count of errors should not have exceeded the page size of 1. Instead it is 
3.

Original comment by azizatif on 4 May 2010 at 9:18

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 4 Oct 2010 at 6:58

GoogleCodeExporter commented 9 years ago
Fixed in r730.

Original comment by azizatif on 4 Oct 2010 at 7:34