cruisecontrol.net - Exception of sending email doesn't show in the CC.net Dashboard -
all, succeed config email publisher in ccnet.config. , works fine. task build, unittest, merge result, etc completed successfully. reason. mistake smtp authentication user name cause exception when run build. way. set notifications always.
<publishers> <statistics /> <merge> <files> <file>testresult\unittestresults.trx</file> </files> </merge> <buildpublisher> <sourcedir>e:\study\cc.net\test\kmih\backupfolder\source</sourcedir> <publishdir>e:\study\cc.net\test\kmih\backupfolder\publish</publishdir> <uselabelsubdirectory>true</uselabelsubdirectory> <alwayspublish>true</alwayspublish> </buildpublisher> <email mailport="25" mailhostusername="xxxxxx" mailhostpassword="xxxxxx" usessl="false" includedetails="true"> <from>xxxxx@163.com</from> <mailhost>smtp.163.com</mailhost> <users> <user name="joewang" group="buildmaster" address="xxxxx@163.com"/> </users> <groups> <group name="buildmaster"> <notifications> <notificationtype>always</notificationtype> </notifications> </group> </groups> </email> <xmllogger/> <artifactcleanup cleanupmethod="keeplastxbuilds" cleanupvalue="50"/> </publishers>
so see error show when check build report of dashboard. can see failed build. didn't found error message or information let me know error is. (in case. wrong email configuration).
am missing ? thanks.
after check out source code. (1.8.5.0) . think found why..
it seems cc.net bug. not.
here exception coming thoughtworks.cruisecontrol.core.tasks.taskbase
.
public virtual void run(iintegrationresult result) { // initialise task this.wassuccessful = false; if ((this.currentstatus == null) || (this.currentstatus.status != itembuildstatus.running)) { initialisestatus(itembuildstatus.pending); currentstatus.status = itembuildstatus.running; } // perform actual run currentstatus.timeofestimatedcompletion = calculateestimatedtime(); currentstatus.timestarted = datetime.now; try { this.wassuccessful = execute(result);//email sending exception threw out... } catch (exception error) { // store error message currentstatus.error = error.message; result.status = integrationstatus.exception; throw; } { // clean currentstatus.status = (this.wassuccessful) ? itembuildstatus.completedsuccess : itembuildstatus.completedfailed; currentstatus.timecompleted = datetime.now; switch (result.status) { case integrationstatus.unknown: case integrationstatus.success: result.status = this.wassuccessful ? integrationstatus.success : integrationstatus.failure; break; } } }
the execute abstract function.
protected abstract bool execute(iintegrationresult result);
and build log built in class xmlintegrationresultwriter
public void write(iintegrationresult result) { writer.writestartelement(elements.cruise_root); writer.writeattributestring("project", result.projectname); writerequest(result.integrationrequest); writemodifications(result.modifications); writeintegrationproperties(result); writebuildelement(result); writeexception(result);//since no exception found . log no exception detail populated. root cause. writer.writeendelement(); }
so think exception should added iintegrationresult below when happened.
try { this.wassuccessful = execute(result); } catch (exception error) { // store error message result.exceptionresult = error;//add exception in build process generated in build log. currentstatus.error = error.message; result.status = integrationstatus.exception; throw; }
i replaced ccnet.exe new compiled one. exception show in build report of dashboard.
any better idea? thanks.
Comments
Post a Comment