We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon no exception message

i have the following table:

table_1
id int(11) PK NOT NULL
name VARCHAR(11)

Note; id is not auto_increment

When i tried to insert:

$this->db->begin();
try{
    $entry = new Table1();
    $entry->name = 'Juan';
    if(!$entry->save()){
        $this->db->rollback();
        echo $entry->getMessage(); //no error
    }
}catch(Exception $e){
    echo $e->getMessage(); //no error
    $this->db->rollback();
}catch(\Phalcon\Mvc\Model\Exception $x){
    echo $x->getMessage(); //no error
    $this->db->rollback();
}catch(\PDOException $r){
    echo $r->getMessage(); //no error
    $this->db->rollback();
}
$this->db->commit();

I expect an error because i didn't define id, id is not auto increment, however, php doesn't give me anything. Please help.

The entry was not inserted btw.

edited Jul '16

And you don't have anything in logs ? What just $entry->save return ? Also you should do print_r($entry->getMessages()) instead of $entry->getMessage() There are no basically method like getMessage() in Phalcon\Mvc\Model, there is getMessages() which returns array of messages.