Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Clearing errors
 

Pages: 1
LLBLGen Pro Runtime Framework
Clearing errors
Page:1/1 

  Print all messages in this thread  
Poster Message
Stoop
User



Location:
Reno, Nevada
Joined on:
28-Feb-2004 12:01:28
Posted:
66 posts
# Posted on: 16-Mar-2004 11:45:46.  
Hi

I've implemented an Error log in SQL where trappable errors are recorded. However, I ran into a situation where I'm not sure what to do. Basically I have this in a nutshell:

(the Company object is created & populated in other part of code..)

Try

'Company email has length of 20 in SQL.
'Generate error on purpose
Company.CompanyEmail = "shshshhsdhsdhhsdhsdhhhds@mycom.com"

Catch ex As System.Exception

dim ErrorObject as New ErrorEntity
Dim adapter As DataAccessAdapter = New DataAccessAdapter
'Set one properties
ErrorObject.ErrorMessage = ex.Message
ErrorObject.ErrorTime = System.DateTime.Now()
'Save to db
Me.adapter.SaveEntity(ErrorObject)

End Try

OK - what happens is, of course, the SSLgen classes catch the error as a System.ArgumentOutOfRangeException in the SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.ValidateValue method

The problem is that now I can't use the ErrorEntity to write the error to the db. Stepping through the code just "skips" right over it. I need a way to "Clear" or set the validation back to true so I can save the error info to the db..

Thanks





  Top
Stoop
User



Location:
Reno, Nevada
Joined on:
28-Feb-2004 12:01:28
Posted:
66 posts
# Posted on: 16-Mar-2004 11:56:48.  
PS I well aware that good business rules (which I have implemented) would catch this BEFORE anthing happens.

However, I want to know the answer to this question because after development & testing, once an app goes live, we all know that users come up with ways we never thought of to break code (especially in an ASP.NET app).

I want this ability so I can log any of my any faulty business logic (without being a show stopper to the user) once this goes live and real users are using the app in real life.


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37317 posts
# Posted on: 16-Mar-2004 22:46:15.  
I might miss something, but why isn't the errorentity object saved into the db? Does it crash on the SaveEntity(errorObject) method?
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Stoop
User



Location:
Reno, Nevada
Joined on:
28-Feb-2004 12:01:28
Posted:
66 posts
# Posted on: 17-Mar-2004 10:55:27.  
Hi

Problem resolved!! No problems with LLGen code.... Regular Smiley

Steve


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37317 posts
# Posted on: 17-Mar-2004 11:15:33.  
Ok! Regular Smiley
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.