Sequelizejs isn't showing up all the validation errors or messages

This is my models.js

var User = require('../../managedb').User;

module.exports = function(sequelize, DataTypes) {


  return sequelize.define('User', {
    username: {
      type: DataTypes.STRING,
      unique: {
        msg: "Username already exists!"
      }
    },
    password: {
      type: DataTypes.STRING,
      len: {
        args: 6,
        msg: "Password must be atleast 6 characters in length"
      }
    },
    email_id:{
      type: DataTypes.STRING,
      unique:{
        msg: "Email already exists!"
      },
      validate: {
        isEmail: {
          msg: "Email is invalid!"
        },
        notNull: true,
      }
    },
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true
    }
  },
    {
    instanceMethods: {
      countTasks: function() {
        // how to implement this method ?
      }
    }
  });

This is the error response I get when I try to save an object with a non unique username and email:

'{"length":173,"name":"error","severity":"ERROR","code":"23505","detail":"Key (email_id)=(yup2@gmail.com) already exists.","file":"nbtinsert.c","line":"397","routine":"_bt_check_unique"}'

Do I've to run the validate() function first? Where am I going wrong here?

The validation has to be part of the validate object inside the attribute definition:

return sequelize.define('User', {
  username: {
    type: DataTypes.STRING,
    validate: {
      unique: {
        msg: "Username already exists!"
      }
    }
  }
})