bitweaver
Wiki
wiki Home
List Pages
wiki Books
Orphan Pages
wiki Rankings
Photos
List Galleries
Forums
Browse forums
Files
List Galleries
Categories
List Categories
Sign In
Message Boards
»
04. Support - Packages
Newest
Oldest
Threaded
5
10
20
50
100
All
Messages
Error handling in Bitweaver
Post Reply
hiran
Joined: 28 Nov 2006
Error handling in Bitweaver
Posted:07 Jan 2007 (23:22 UTC)
Kozuch
Joined: 06 Mar 2006
Posted:15 Feb 2007 (21:50 UTC)
Post Reply
Page 1 of 1
1
Post
Title
Login
If you are already registered, please enter your login credentials.
Your Name
Anonymous Post
Content Format
Tiki Wiki Syntax
Allow HTML
{quote format_guid="bbcode" comment_id="7467" user="hiran"}Is there some decent error handling available? What are best practices? Unfortunately the sample package does not do anything. Have a look at the BitSample::store method. It does not care whether an insert or update was successful. It does not care if the super::store mthod was successful and just itself failed. I can try and read the other packages' classes, which look much more complicated, or I can think of something myself. But that will never change the sample code which every newbie should look at.... [code:1:76734795fc] function store( &$pParamHash ) { if( $this->verify( $pParamHash )&& LibertyAttachable::store( $pParamHash ) ) { $table = BIT_DB_PREFIX."samples"; $this->mDb->StartTrans(); if( $this->mSampleId ) { $locId = array( "sample_id" => $pParamHash['sample_id'] ); $result = $this->mDb->associateUpdate( $table, $pParamHash['sample_store'], $locId ); } else { $pParamHash['sample_store']['content_id'] = $pParamHash['content_id']; if( @$this->verifyId( $pParamHash['sample_id'] ) ) { // if pParamHash['sample_id'] is set, some is requesting a particular sample_id. Use with caution! $pParamHash['sample_store']['sample_id'] = $pParamHash['sample_id']; } else { $pParamHash['sample_store']['sample_id'] = $this->mDb->GenID( 'samples_sample_id_seq' ); } $this->mSampleId = $pParamHash['sample_store']['sample_id']; $result = $this->mDb->associateInsert( $table, $pParamHash['sample_store'] ); } $this->mDb->CompleteTrans(); $this->load(); } return( count( $this->mErrors )== 0 ); } [/code:1:76734795fc]{/quote}
Recent Page Changes
welcome to bitweaver.org
Bitweaver Overview
ReleaseTwo Schema Changelog 2006
PressReleaseOne
Spider's Web
Press Release Two
BitcommercePackage
InfiniBand vs Ethernet Performance
InfiniBand for Dummies
Show More…