从服务器向客户端发送错误-FullStack JS

时间:2020-02-24 09:45:12

标签: mongoose mern react-fullstack

我目前正在处理第一个MERN全栈(使用猫鼬)。

我正在尝试涵盖所有可能的错误,包括服务器端错误,并通知客户端。例如:我试图在我的本地MongoDB服务器未运行时运行该应用程序,以查找该特定错误并捕获它。 因此,当然会有一个错误,但是似乎<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateDepartmentsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('departments', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->integer('parent'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('departments'); } } 之后的name: order-process tasks: - id: collect-money type: payment-service - id: fetch-items type: inventory-service switch: - case: totalPrice > 100 goto: ship-parcel-with-insurance - default: ship-parcel - id: ship-parcel-with-insurance type: shipment-service-premium end: true - id: ship-parcel type: shipment-service (EventNote是猫鼬模型)没有捕获到它,并且肯定不会将其发送回客户端(理想情况下)将会弹出一个模态)。 任何帮助将不胜感激!

注意:应用程序和路由-它们均按预期工作,因此要求确实到达路由,通常确实发回预期的数据。

Error: unparsable content detected
    line: 0
    column: 0
    nested error: missing start tag

1 个答案:

答案 0 :(得分:0)

好。由于我尝试创建该特定于 的错误,因此该错误发生在mongoose.connect上,而不是在尝试访问路由时出现的...