mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 21:45:42 +02:00
Fix message catching the field for which a duplicate key error ocurred
This commit is contained in:
@@ -7,7 +7,7 @@ var getUniqueErrorMessage = function(err) {
|
||||
var output;
|
||||
|
||||
try {
|
||||
var fieldName = err.err.substring(err.err.lastIndexOf('.$') + 2, err.err.lastIndexOf('_1'));
|
||||
var fieldName = err.errmsg.substring(err.errmsg.lastIndexOf('.$') + 2, err.errmsg.lastIndexOf('_1'));
|
||||
output = fieldName.charAt(0).toUpperCase() + fieldName.slice(1) + ' already exists';
|
||||
|
||||
} catch(ex) {
|
||||
|
||||
Reference in New Issue
Block a user