Correcting error handling in assembly restocking

--HG--
extra : source : eed99aabd2a8f38c37cd84203b42c8fcd221fd85
Merge pull request #254 from einhverfr/master

correcting db error handling