birdofpreyru/react-native-static-server

Improve native error messages

birdofpreyru opened this issue · 1 comments

For native error messages that are related to a particular server instance(s), we should include server ID(s) into the messages, to facilitate debugging using logs. And it is better to do it in the native layer, rather than inject assumed IDs in TS layer.

ANOTHER_INSTANCE_IS_ACTIVE(
"Failed to launch, another server instance is active."),
FAIL_GET_LOCAL_IP_ADDRESS("Failed to get local IP adddress"),
FAIL_GET_OPEN_PORT("Failed to get an open port"),
INTERNAL_ERROR("Internal error"),
SERVER_CRASHED("Server crashed"),
STOP_FAILURE("Failed to gracefully shutdown the server");

☝️ This code is Android, but the issue is relevant for all platforms.

Done for Android, iOS, and macOS in v0.10.2. For Windows, I guess, it will wait until some other upgrades have to be done there.