bewizyu / familink-api

Training api project for the familink mobile application
MIT License
1 stars 17 forks source link

Update Contact fail. #26

Closed CorentinTerente closed 5 years ago

CorentinTerente commented 5 years ago

{{uri}}/secured/users/contacts/5c38e9730db640087226764

id non existant en base de données, renvoie une erreur 500 non catché:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>CastError: Cast to ObjectId failed for value &quot;5c38e9730db640087226764&quot; at path &quot;_id&quot; for model &quot;user&quot;
            <br> &nbsp; &nbsp;at new CastError (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/error/cast.js:27:11)
            <br> &nbsp; &nbsp;at ObjectId.cast (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/schema/objectid.js:158:13)
            <br> &nbsp; &nbsp;at ObjectId.SchemaType._castForQuery (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/schematype.js:1088:15)
            <br> &nbsp; &nbsp;at ObjectId.castForQuery (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/schema/objectid.js:198:15)
            <br> &nbsp; &nbsp;at ObjectId.SchemaType.castForQueryWrapper (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/schematype.js:1045:15)
            <br> &nbsp; &nbsp;at cast (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/cast.js:269:32)
            <br> &nbsp; &nbsp;at cast (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/cast.js:92:25)
            <br> &nbsp; &nbsp;at model.Query.Query.cast (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/query.js:3305:12)
            <br> &nbsp; &nbsp;at castQuery (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/query.js:3194:18)
            <br> &nbsp; &nbsp;at _update (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/query.js:3013:21)
            <br> &nbsp; &nbsp;at model.Query.Query.update (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/mongoose/lib/query.js:2811:10)
            <br> &nbsp; &nbsp;at Object.updateContact (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/src/users/user.services.js:175:6)
            <br> &nbsp; &nbsp;at updateContact (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/src/users/user.controller.js:127:16)
            <br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/express/lib/router/layer.js:95:5)
            <br> &nbsp; &nbsp;at next (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/express/lib/router/route.js:137:13)
            <br> &nbsp; &nbsp;at Route.dispatch (/home/bas/app_968e6bc9-3efe-43a2-b4a1-6d138d6971f6/node_modules/express/lib/router/route.js:112:3)
        </pre>
    </body>
</html>