Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* eslint-disable consistent-return */
- export const decodeError = (message, lang) => {
- if (lang === 'id') {
- switch (message) {
- case 'internal server error':
- return 'Terjadi kesalahan pada server';
- case 'Invalid user status':
- return 'Status user tidak valid';
- case 'too_many_request':
- return 'Request telah mencapai batas maksimal untuk hari ini';
- case 'invalid_body':
- return 'Silahkan isi kolom yang masih kosong';
- case 'country_code_not_exist':
- return 'Kode negara tidak ditemukan';
- case 'invalid_phone_length':
- return 'Panjang nomor telepon tidak valid';
- case 'invalid_phone_format':
- return 'Format nomor telepon tidak valid';
- case 'phone_too_much':
- return 'Nomor telah mencapai batas maksimal pendaftaran';
- case 'email_exist':
- return 'Email telah terdaftar';
- case 'db_submit':
- return 'Kesalahan saat mengirim ke Database';
- case 'otp':
- return 'Gagal menghasilkan OTP';
- case 'jwt':
- return 'Gagal menghasilkan JWT';
- case 'send_sms':
- return 'Gagal mengirim SMS';
- case 'record_not_exist':
- return 'Data tidak ditemukan';
- case 'same_phone':
- return 'Nomor telepon yang anda masukkan sama';
- case 'db_update':
- return 'Kesalahan saat memperbarui ke Database';
- case 'exp_otp':
- return 'OTP telah kadaluarsa';
- case 'wrong_otp':
- return 'OTP salah';
- case 'activation_mail':
- return 'Gagal mengirim email aktivasi';
- case 'invalid_email_key':
- return 'Key aktivasi salah atau sudah kadaluarsa';
- case 'send_mail':
- return 'Gagal mengirim email aktivasi';
- case 'same_email':
- return 'Email yang anda masukkan sama';
- case 'user_not_found':
- return 'Email / Password salah';
- case 'file_too_big':
- return 'Ukuran file terlalu besar';
- case 'invalid_file_type':
- return 'Tipe file tidak valid';
- case 'file_error':
- return 'Gagal membaca file';
- case 'upload_file_error':
- return 'Gagal mengunggah file';
- case 'invalid_identity_image':
- return 'Gagal menemukan foto KTP';
- case 'invalid_ocr':
- return 'NIK Tidak Cocok dengan foto e-KTP';
- case 'invalid_selfie_image':
- return 'Gagal menemukan foto selfie KTP';
- case 'invalid_face_recognition':
- return 'Foto selfie tidak cocok dengan foto pada KTP';
- case 'gender_not_found':
- return 'Jenis kelamin tidak ditemukan';
- case 'get_dukcapil_data':
- return 'Gagal mendapatkan data dari Dukcapil';
- case 'empty_dukcapil_data':
- return 'Data dari Dukcapil tidak ditemukan';
- case 'invalid_name':
- return 'Nama yang Anda Pilih Tidak Sesuai';
- case 'max_detail':
- return 'Maksimal 3 detail';
- case 'invalid_signature_image':
- return 'Gagal menemukan spesimen tanda tangan';
- case 'invalid_npwp_image':
- return 'Gagal menemukan foto NPWP';
- case 'invalid_npwp_ocr':
- return 'Nomor NPWP Tidak Cocok dengan Foto NPWP';
- case 'country_tax_detail':
- return 'Negara tidak valid';
- case 'ba_format':
- return 'Format nomor rekening tidak valid';
- case 'mailing_address_type':
- return 'Alamat surat-menyurat tidak valid';
- case 'job_start_at':
- return 'Tanggal mulai bekerja tidak relevan';
- case 'invalid_birth_date':
- return 'Format tanggal lahir tidak valid';
- case 'dukcapil_complete':
- return 'Data dukcapil sudah lengkap';
- case 'fill_all_data':
- return 'Silahkan isi semua data secara lengkap';
- case 'connection_error':
- return 'Koneksi gagal';
- case 'password_length':
- return 'Panjang password harus 6 hingga 10 karakter';
- case 'password_format':
- return 'Password harus terdiri dari minimal 3 kriteria berikut: huruf besar, huruf kecil, angka, dan simbol';
- case 'user_locked':
- return 'Akun terkunci';
- case 'invalid_phone_region_length':
- return 'Panjang kode area tidak valid';
- case 'npwp_format':
- return 'Format nomor NPWP tidak valid';
- case 'redirect_to_login':
- return 'Email sudah terdaftar';
- case 'recaptcha':
- return 'Kesalahan pada recaptcha';
- case 'plafond_too_small':
- return 'Jumlah plafond terlalu rendah';
- case 'plafond_too_big':
- return 'Jumlah plafond terlalu tinggi';
- case 'invalid_spouse_name':
- return 'Nama pasangan belum diisi';
- case 'invalid_spouse_phone':
- return 'Nomor ponsel pasangan belum diisi';
- case 'invalid_spouse_email':
- return 'Email pasangan belum diisi';
- case 'unfinished_application':
- return 'Unfinished Application';
- case 'note_already_filled':
- return 'Note Already Filled';
- case 'invalid_status':
- return 'Invalid Status';
- case 'margin_confirmation_mail':
- return 'Margin Confirmation Mail';
- case 'spouse_email_same_with_user':
- return 'Anda tidak dapat menggunakan <i>e-mail</i> yang sama';
- case 'max_spouse_rejected':
- return 'Pengajuan Anda telah ditolak pasangan Anda sebanyak 2x';
- case 'invalid_image_type':
- return 'Invalid image type';
- case 'repair_user_data_mail':
- return 'Repair User Data';
- case 'Not found repair data':
- return 'Review Data Admin ';
- case 'phone_email_exist':
- return 'Phone Email Exist';
- case 'privy_already_registered':
- return 'Privy Already Registered';
- case 'code_exist':
- return 'Privy Already Registered';
- case 'default_partner_exist':
- return 'Default Partner Exist';
- case 'already_submit_margin':
- return 'Already Submit Margin';
- default:
- return 'Maaf, sedang ada kendala teknis pada sistem';
- }
- } else if (lang === 'en') {
- switch (message) {
- case 'internal server error':
- return 'Internal server error';
- case 'Invalid user status':
- return 'Invalid user status';
- case 'too_many_request':
- return 'Too many request for today';
- case 'invalid_body':
- return 'Please fill the empty field';
- case 'country_code_not_exist':
- return 'Country code not exist';
- case 'invalid_phone_length':
- return 'Invalid phone length';
- case 'invalid_phone_format':
- return 'Invalid phone format';
- case 'phone_too_much':
- return 'Too much duplication on phone number';
- case 'email_exist':
- return 'Email already registered';
- case 'db_submit':
- return 'Error on submitting to Database';
- case 'otp':
- return 'Fail to generate OTP';
- case 'jwt':
- return 'Fail to generate JWT';
- case 'send_sms':
- return 'Fail to send SMS';
- case 'record_not_exist':
- return 'Record does not exist';
- case 'same_phone':
- return 'New phone same with the old one';
- case 'db_update':
- return 'Error on updating to Database';
- case 'exp_otp':
- return 'OTP already expired';
- case 'wrong_otp':
- return 'Wrong OTP';
- case 'activation_mail':
- return 'Send activation email failed';
- case 'invalid_email_key':
- return 'Wrong activation key or already expired';
- case 'send_mail':
- return 'Send activation email failed';
- case 'same_email':
- return 'New email same with the old one';
- case 'user_not_found':
- return 'Invalid Email / Password';
- case 'file_too_big':
- return 'File size too big';
- case 'invalid_file_type':
- return 'invalid file type';
- case 'file_error':
- return 'Read file error';
- case 'upload_file_error':
- return 'Upload file error';
- case 'invalid_identity_image':
- return 'Invalid identity image';
- case 'invalid_ocr':
- return 'Identity number different with uploaded image';
- case 'invalid_selfie_image':
- return 'Invalid selfie image';
- case 'invalid_face_recognition':
- return 'Profile and identity photo is not identical';
- case 'gender_not_found':
- return 'Gender not found';
- case 'get_dukcapil_data':
- return 'Get Dukcapil data failed';
- case 'empty_dukcapil_data':
- return 'Empty Dukcapil data';
- case 'invalid_name':
- return 'Incorrect answer';
- case 'max_detail':
- return 'Maximum 3 detail can be recorded';
- case 'invalid_signature_image':
- return 'Invalid signature image';
- case 'invalid_npwp_image':
- return 'invalid NPWP image';
- case 'invalid_npwp_ocr':
- return 'NPWP number different with uploaded image';
- case 'country_tax_detail':
- return 'Invalid country on tax detail';
- case 'ba_format':
- return 'Invalid bank account format';
- case 'mailing_address_type':
- return 'Invalid mailing address type';
- case 'job_start_at':
- return 'Invalid date job start at';
- case 'invalid_birth_date':
- return 'invalid birthdate';
- case 'dukcapil_complete':
- return 'All Dukcapil data already completed';
- case 'fill_all_data':
- return 'Please fill all your data first';
- case 'connection_error':
- return 'Connection error';
- case 'password_length':
- return 'password length must be 6 to 10 characters';
- case 'password_format':
- return 'Password must includes at least 3 criterias of : uppercase letters, lowercase letters, numbers, and symbols';
- case 'user_locked':
- return 'Account locked';
- case 'invalid_phone_region_length':
- return 'Invalid phone region length';
- case 'npwp_format':
- return 'Invalid NPWP number';
- case 'redirect_to_login':
- return 'Email already registered';
- case 'recaptcha':
- return 'Recapthca Error';
- case 'plafond_too_small':
- return 'Plafond too small';
- case 'plafond_too_big':
- return 'Plafond too big';
- case 'invalid_spouse_name':
- return 'Spouse name required';
- case 'invalid_spouse_phone':
- return 'Spouse phone required';
- case 'invalid_spouse_email':
- return 'Spouse Email required';
- case 'invalid_spouse_name':
- return 'Nama pasangan belum diisi';
- case 'invalid_spouse_phone':
- return 'Nomor ponsel pasangan belum diisi';
- case 'invalid_spouse_email':
- return 'Email pasangan belum diisi';
- case 'unfinished_application':
- return 'Unfinished Application';
- case 'note_already_filled':
- return 'Note Already Filled';
- case 'invalid_status':
- return 'Invalid Status';
- case 'margin_confirmation_mail':
- return 'Margin Confirmation Mail';
- case 'spouse_email_same_with_user':
- return 'Spouse email same with user';
- case 'max_spouse_rejected':
- return 'Max spouse rejected';
- case 'invalid_image_type':
- return 'Invalid image type';
- case 'repair_user_data_mail':
- return 'Repair User Data';
- case 'Not found repair data':
- return 'Review Data Admin ';
- case 'phone_email_exist':
- return 'Phone Email Exist';
- case 'privy_already_registered':
- return 'Privy Already Registered';
- case 'code_exist':
- return 'Privy Already Registered';
- case 'default_partner_exist':
- return 'Default Partner Exist';
- case 'already_submit_margin':
- return 'Already Submit Margin';
- default:
- return 'Sorry, there are some technical problems';
- }
- }
- };
Add Comment
Please, Sign In to add comment