Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
error(message: string) {
notificationState.addNotification({
message,
status: NotificationStatus.ERROR,
});
},
success(message: string) {
server.ports = newPorts;
break;
}
case 'sandbox:error': {
const { message: error, unrecoverable } = data;
server.hasUnrecoverableError = unrecoverable;
server.error = error;
if (unrecoverable) {
effects.notificationToast.add({
title: `Container Error`,
message: error,
status: NotificationStatus.ERROR,
});
effects.executor.closeExecutor();
} else {
effects.notificationToast.add({
title: `Container Warning`,
message: error,
status: NotificationStatus.WARNING,
});
}
break;
}
case 'shell:exit':
effects.codesandboxApi.exitShell(data);
break;
case 'shell:out':
const getStatus = () => {
switch (type) {
case 'error':
return NotificationStatus.ERROR;
case 'warning':
return NotificationStatus.WARNING;
case 'success':
return NotificationStatus.SUCCESS;
default:
return NotificationStatus.NOTICE;
}
};
({ state, effects }) => {
if (!state.live.reconnecting) {
effects.notificationToast.add({
message: 'We lost connection with the live server, reconnecting...',
status: NotificationStatus.ERROR,
});
state.live.reconnecting = true;
}
}
);