Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
warning(message: string) {
notificationState.addNotification({
message,
status: NotificationStatus.WARNING,
});
},
notice(message: string) {
const getStatus = () => {
switch (type) {
case 'error':
return NotificationStatus.ERROR;
case 'warning':
return NotificationStatus.WARNING;
case 'success':
return NotificationStatus.SUCCESS;
default:
return NotificationStatus.NOTICE;
}
};
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':
effects.codesandboxApi.outShell(data);
break;
}
};