uniformize code

This commit is contained in:
Regis Houssin 2011-09-03 16:37:12 +00:00
parent 3890f8e79d
commit 470d0749a5

View File

@ -1150,21 +1150,22 @@ class User extends CommonObject
if (! $error) if (! $error)
{ {
$this->db->commit(); $this->db->commit();
return $nbrowsaffected;
} }
else else
{ {
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::update error=".$this->error,LOG_ERR);
$this->db->rollback(); $this->db->rollback();
return -1;
} }
return $nbrowsaffected;
} }
else else
{ {
$this->db->rollback();
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
dol_syslog("User::update ".$this->error,LOG_ERR); dol_syslog(get_class($this)."::update error=".$this->error,LOG_ERR);
return -1; $this->db->rollback();
return -2;
} }
} }