team-ljyzipelo

공개
816줄26 KB
1use std::{collections::BTreeSet, path::PathBuf};
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
4pub enum Format {
5 Zip,
6 Tar,
7 Gzip,
8 TarGzip,
9}
10#[derive(Clone, Debug, Eq, PartialEq)]
11pub enum SourceObject {
12 Unix { device: u64, inode: u64 },
13 Windows { volume: u64, file_id: [u8; 16] },
14}
15#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct ListId {
17 pub catalog_version: u16,
18 pub format: Format,
19 pub source_object: SourceObject,
20 pub archive_bytes: u64,
21 pub archive_sha256: [u8; 32],
22}
23#[derive(Clone, Debug, Eq, PartialEq)]
24pub enum Selection {
25 All,
26 EntryIds(Vec<u32>),
27}
28#[derive(Clone, Copy, Debug, Eq, PartialEq)]
29pub enum Method {
30 Store,
31 Deflate,
32}
33#[derive(Clone, Debug, Eq, PartialEq)]
34pub enum Start {
35 List {
36 archive: PathBuf,
37 },
38 Extract {
39 archive: PathBuf,
40 destination: PathBuf,
41 selection: Selection,
42 list_id: ListId,
43 gzip_output_name: Option<String>,
44 },
45 CreateZip {
46 sources: Vec<(PathBuf, String)>,
47 output_file: PathBuf,
48 method: Method,
49 aes256: bool,
50 },
51}
52// 암호를 Debug와 로그에서 제외하고 소유 버퍼를 해제 전에 지움.
53pub struct Secret(Vec<u8>);
54impl Secret {
55 pub fn new(text: String) -> Result<Self, &'static str> {
56 let mut bytes = text.into_bytes();
57 if bytes.is_empty() || bytes.len() > 1024 {
58 bytes.fill(0);
59 return Err("암호는 UTF-8 1~1024바이트로 입력하세요");
60 }
61 Ok(Self(bytes))
62 }
63 pub fn as_bytes(&self) -> &[u8] {
64 &self.0
65 }
66}
67impl Drop for Secret {
68 fn drop(&mut self) {
69 self.0.fill(0);
70 }
71}
72pub enum Command {
73 Start(Start),
74 Password { challenge_id: u64, secret: Secret },
75 Cancel,
76}
77pub struct Request {
78 pub job_id: u64,
79 pub sequence: u64,
80 pub command: Command,
81}
82#[derive(Clone, Copy, Debug, Eq, PartialEq)]
83pub enum Kind {
84 File,
85 Directory,
86 Link,
87 Other,
88}
89#[derive(Clone, Debug, Eq, PartialEq)]
90pub struct Entry {
91 pub id: u32,
92 pub name: String,
93 pub kind: Kind,
94 pub bytes: Option<u64>,
95 pub packed: Option<u64>,
96 pub encrypted: bool,
97}
98#[derive(Clone, Copy, Debug, Eq, PartialEq)]
99pub enum CancelStatus {
100 Requested,
101 AlreadyRequested,
102 TooLate,
103 Finished,
104}
105#[derive(Clone, Copy, Debug, Eq, PartialEq)]
106pub enum Stage {
107 Scan,
108 Read,
109 Decode,
110 Write,
111 Verify,
112 Commit,
113}
114#[derive(Clone, Copy, Debug, Eq, PartialEq)]
115pub enum Outcome {
116 Completed,
117 Failed,
118 Cancelled,
119}
120#[derive(Clone, Copy, Debug, Eq, PartialEq)]
121pub enum ErrorCode {
122 Integrity,
123 UnsupportedFormat,
124 UnsupportedFeature,
125 WrongPassword,
126 UnsafePath,
127 Conflict,
128 Limit,
129 Io,
130 Protocol,
131 Internal,
132 SourceChanged,
133 InvalidRequest,
134}
135#[derive(Clone, Copy, Debug, Eq, PartialEq)]
136pub enum Publication {
137 None,
138 Partial,
139 Complete,
140 Uncertain,
141}
142#[derive(Clone, Copy, Debug, Eq, PartialEq)]
143pub enum Durability {
144 NotApplicable,
145 Synced,
146 Unconfirmed,
147 Failed,
148}
149#[derive(Clone, Copy, Debug, Eq, PartialEq)]
150pub enum Cleanup {
151 Complete,
152 Failed,
153 Unconfirmed,
154}
155#[derive(Clone, Copy, Debug, Eq, PartialEq)]
156pub enum Disposition {
157 Created,
158 PartialRetained,
159 Removed,
160 CommitUncertain,
161}
162#[derive(Clone, Debug)]
163pub struct Terminal {
164 pub outcome: Outcome,
165 pub error: Option<ErrorCode>,
166 pub publication: Publication,
167 pub created_count: u64,
168 pub retained_partial_count: u64,
169 pub durability: Durability,
170 pub cleanup: Cleanup,
171}
172#[derive(Clone, Debug)]
173pub enum Event {
174 Accepted {
175 encryption: bool,
176 },
177 Entry(Entry),
178 ListEnd {
179 entry_count: u32,
180 list_id: ListId,
181 },
182 PasswordRequired {
183 challenge_id: u64,
184 attempt: u32,
185 encrypt: bool,
186 },
187 Progress {
188 stage: Stage,
189 processed: u64,
190 total: Option<u64>,
191 completed_entries: u64,
192 },
193 Output {
194 entry_id: Option<u32>,
195 relative_name: String,
196 disposition: Disposition,
197 },
198 CancelAck {
199 request_sequence: u64,
200 status: CancelStatus,
201 },
202 Terminal(Terminal),
203}
204pub enum HostEvent {
205 Fault(String),
206 CleanupComplete,
207 Frame {
208 job_id: u64,
209 sequence: u64,
210 event: Event,
211 },
212 StdoutEof,
213 StderrEof,
214 Exited {
215 success: bool,
216 },
217}
218// 바이트 codec과 프로세스 소유는 작업자 어댑터에서 담당함.
219// 전송 실패 후에도 poll로 양쪽 EOF와 자식 회수 결과를 전달함.
220pub trait Connection {
221 fn send(&mut self, request: Request) -> Result<(), String>;
222 fn poll(&mut self) -> Option<HostEvent>;
223}
224pub trait Factory {
225 fn connect(&mut self, job_id: u64) -> Result<Box<dyn Connection>, String>;
226}
227pub struct Unavailable;
228impl Factory for Unavailable {
229 fn connect(&mut self, _: u64) -> Result<Box<dyn Connection>, String> {
230 Err("작업자 연결이 아직 준비되지 않았습니다".into())
231 }
232}
233struct Running {
234 id: u64,
235 outgoing: u64,
236 incoming: u64,
237 accepted: bool,
238 start_failed: bool,
239 start: Start,
240 connection: Box<dyn Connection>,
241 entries: Vec<Entry>,
242 list_end: Option<(u32, ListId)>,
243 stdout_eof: bool,
244 transport_closed: bool,
245 stderr_eof: bool,
246 exit: Option<bool>,
247 cancel_sequence: Option<u64>,
248}
249#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
250pub enum Close {
251 #[default]
252 Open,
253 Confirm,
254 Waiting,
255 Review,
256 Allowed,
257}
258#[derive(Default)]
259pub struct Model {
260 running: Option<Running>,
261 next_id: u64,
262 pub archive: Option<PathBuf>,
263 pub entries: Vec<Entry>,
264 pub list_id: Option<ListId>,
265 pub selected: BTreeSet<u32>,
266 pub terminal: Option<Terminal>,
267 pub challenge: Option<(u64, u32, bool)>,
268 pub progress: Option<(Stage, u64, Option<u64>, u64)>,
269 pub outputs: Vec<(String, Disposition)>,
270 pub cancel: Option<CancelStatus>,
271 pub error: Option<String>,
272 pub input_error: Option<String>,
273 pub encryption: bool,
274 pub close: Close,
275 pub confirmed: bool,
276}
277impl Model {
278 pub fn busy(&self) -> bool {
279 self.running.is_some()
280 }
281 pub fn job_id(&self) -> Option<u64> {
282 self.running.as_ref().map(|r| r.id)
283 }
284 pub fn can_extract(&self) -> bool {
285 !self.busy()
286 && self.list_id.is_some()
287 && self.archive.is_some()
288 && self.close == Close::Open
289 }
290 pub fn begin(&mut self, start: Start, factory: &mut dyn Factory) -> bool {
291 if self.busy() || self.close != Close::Open {
292 return false;
293 }
294 let validation = match &start {
295 Start::List { archive } => archive.is_absolute(),
296 Start::Extract {
297 archive,
298 destination,
299 selection,
300 gzip_output_name,
301 list_id,
302 } => {
303 archive.is_absolute()
304 && destination.is_absolute()
305 && self.archive.as_ref() == Some(archive)
306 && self.list_id.as_ref() == Some(list_id)
307 && match list_id.format {
308 Format::Gzip => gzip_output_name.as_ref().is_some_and(|s| valid_leaf(s)),
309 _ => gzip_output_name.is_none(),
310 }
311 && match selection {
312 Selection::All => true,
313 Selection::EntryIds(ids) => {
314 !ids.is_empty()
315 && ids.iter().collect::<BTreeSet<_>>().len() == ids.len()
316 && ids.iter().all(|id| {
317 self.entries.iter().any(|e| {
318 e.id == *id
319 && matches!(e.kind, Kind::File | Kind::Directory)
320 })
321 })
322 }
323 }
324 }
325 Start::CreateZip {
326 sources,
327 output_file,
328 ..
329 } => {
330 !sources.is_empty()
331 && output_file.is_absolute()
332 && sources
333 .iter()
334 .all(|(p, n)| p.is_absolute() && valid_relative(n))
335 }
336 };
337 if !validation {
338 self.input_error = Some("입력 경로, 출력명과 선택한 목록을 확인하세요".into());
339 return false;
340 }
341 let Some(id) = self.next_id.checked_add(1) else {
342 self.error = Some("작업 ID 한도에 도달했습니다".into());
343 return false;
344 };
345 let mut connection = match factory.connect(id) {
346 Ok(c) => c,
347 Err(e) => {
348 self.error = Some(e);
349 return false;
350 }
351 };
352 let send_error = connection
353 .send(Request {
354 job_id: id,
355 sequence: 0,
356 command: Command::Start(start.clone()),
357 })
358 .err();
359 let started = send_error.is_none();
360 if let Start::List { archive } = &start
361 && started
362 {
363 self.archive = Some(archive.clone());
364 self.list_id = None;
365 self.entries.clear();
366 self.selected.clear();
367 }
368 self.next_id = id;
369 self.terminal = None;
370 self.challenge = None;
371 self.progress = None;
372 self.outputs.clear();
373 self.cancel = None;
374 self.input_error = None;
375 self.error = send_error;
376 self.confirmed = false;
377 self.running = Some(Running {
378 id,
379 outgoing: 1,
380 incoming: 0,
381 accepted: false,
382 start_failed: !started,
383 start,
384 connection,
385 entries: Vec::new(),
386 list_end: None,
387 stdout_eof: false,
388 transport_closed: false,
389 stderr_eof: false,
390 exit: None,
391 cancel_sequence: None,
392 });
393 started
394 }
395 pub fn extract(
396 &mut self,
397 destination: PathBuf,
398 selected_only: bool,
399 gzip_output_name: Option<String>,
400 factory: &mut dyn Factory,
401 ) -> bool {
402 if !self.can_extract() {
403 return false;
404 }
405 self.begin(
406 Start::Extract {
407 archive: self.archive.clone().unwrap(),
408 destination,
409 selection: if selected_only {
410 Selection::EntryIds(self.selected.iter().copied().collect())
411 } else {
412 Selection::All
413 },
414 list_id: self.list_id.clone().unwrap(),
415 gzip_output_name,
416 },
417 factory,
418 )
419 }
420 pub fn password(&mut self, text: String) -> bool {
421 let Some((challenge_id, _, _)) = self.challenge else {
422 return false;
423 };
424 let secret = match Secret::new(text) {
425 Ok(s) => s,
426 Err(e) => {
427 self.input_error = Some(e.into());
428 return false;
429 }
430 };
431 if self
432 .send(Command::Password {
433 challenge_id,
434 secret,
435 })
436 .is_some()
437 {
438 self.challenge = None;
439 self.input_error = None;
440 true
441 } else {
442 false
443 }
444 }
445 fn send(&mut self, command: Command) -> Option<u64> {
446 let run = self.running.as_mut()?;
447 if run.start_failed || self.terminal.is_some() || run.exit.is_some() {
448 return None;
449 }
450 let seq = run.outgoing;
451 let Some(next) = seq.checked_add(1) else {
452 self.error = Some("요청 순서 한도 초과".into());
453 return None;
454 };
455 match run.connection.send(Request {
456 job_id: run.id,
457 sequence: seq,
458 command,
459 }) {
460 Ok(()) => {
461 run.outgoing = next;
462 Some(seq)
463 }
464 Err(e) => {
465 self.error = Some(e);
466 None
467 }
468 }
469 }
470 pub fn cancel(&mut self) {
471 if self
472 .running
473 .as_ref()
474 .is_some_and(|r| r.cancel_sequence.is_none())
475 {
476 if let Some(seq) = self.send(Command::Cancel) {
477 self.running.as_mut().unwrap().cancel_sequence = Some(seq);
478 self.challenge = None;
479 self.input_error = None;
480 }
481 }
482 }
483 pub fn request_close(&mut self) {
484 if self.close == Close::Open {
485 self.close = if self.busy() {
486 Close::Confirm
487 } else {
488 Close::Review
489 };
490 }
491 }
492 pub fn confirm_close(&mut self) {
493 if self.close == Close::Confirm {
494 self.cancel();
495 self.close = if self.busy() {
496 Close::Waiting
497 } else {
498 Close::Review
499 };
500 }
501 }
502 pub fn keep_open(&mut self) {
503 if self.close != Close::Allowed {
504 self.close = Close::Open;
505 }
506 }
507 pub fn acknowledge_close(&mut self) {
508 if !self.busy() && self.close == Close::Review {
509 self.close = Close::Allowed;
510 }
511 }
512 pub fn poll(&mut self) {
513 for _ in 0..128 {
514 let Some(event) = self.running.as_mut().and_then(|r| r.connection.poll()) else {
515 break;
516 };
517 self.receive(event);
518 }
519 let complete = self.running.as_ref().is_some_and(|r| {
520 r.exit.is_some()
521 && ((r.stdout_eof && r.stderr_eof) || (r.transport_closed && self.error.is_some()))
522 });
523 if complete {
524 let run = self.running.take().unwrap();
525 self.confirmed =
526 self.terminal.is_some() && run.exit == Some(true) && self.error.is_none();
527 if !self.confirmed {
528 self.error.get_or_insert(
529 "작업자 종료 결과를 확인할 수 없습니다. 출력 상태를 확인하세요".into(),
530 );
531 }
532 if self.confirmed
533 && self
534 .terminal
535 .as_ref()
536 .is_some_and(|t| t.outcome == Outcome::Completed)
537 {
538 if matches!(run.start, Start::List { .. }) {
539 if let Some((count, id)) = run
540 .list_end
541 .filter(|(n, _)| *n as usize == run.entries.len())
542 {
543 let _ = count;
544 self.entries = run.entries;
545 self.list_id = Some(id);
546 } else {
547 self.error = Some("목록 완료 정보가 일치하지 않습니다. 다시 여세요".into());
548 self.confirmed = false;
549 }
550 }
551 }
552 if self
553 .terminal
554 .as_ref()
555 .is_some_and(|t| t.error == Some(ErrorCode::SourceChanged))
556 {
557 self.list_id = None;
558 self.selected.clear();
559 }
560 self.challenge = None;
561 self.input_error = None;
562 if matches!(self.close, Close::Waiting | Close::Confirm) {
563 self.close = Close::Review;
564 }
565 }
566 }
567 fn receive(&mut self, host: HostEvent) {
568 let run = self.running.as_mut().unwrap();
569 match host {
570 HostEvent::Fault(message) => self.error = Some(message),
571 HostEvent::CleanupComplete => run.transport_closed = true,
572 HostEvent::StdoutEof => run.stdout_eof = true,
573 HostEvent::StderrEof => run.stderr_eof = true,
574 HostEvent::Exited { success } => run.exit = Some(success),
575 HostEvent::Frame {
576 job_id,
577 sequence,
578 event,
579 } => {
580 if job_id != run.id
581 || sequence != run.incoming
582 || self.terminal.is_some()
583 || run.stdout_eof
584 || sequence >= 1_000_000
585 {
586 self.error = Some("작업자 응답 순서나 작업 ID가 일치하지 않습니다".into());
587 return;
588 }
589 run.incoming += 1;
590 if !run.accepted && !matches!(event, Event::Accepted { .. }) {
591 self.error = Some("작업 승인 응답이 없습니다".into());
592 return;
593 }
594 match event {
595 Event::Accepted { encryption } => {
596 if run.accepted {
597 self.error = Some("작업 승인 중복".into());
598 }
599 run.accepted = true;
600 self.encryption = encryption;
601 }
602 Event::Entry(entry) => {
603 if !matches!(run.start, Start::List { .. })
604 || run.list_end.is_some()
605 || entry.id as usize != run.entries.len()
606 || entry.name.len() > 4096
607 || run.entries.len() >= 100_000
608 {
609 self.error = Some("목록 응답이 유효하지 않습니다".into());
610 } else {
611 run.entries.push(entry);
612 }
613 }
614 Event::ListEnd {
615 entry_count,
616 list_id,
617 } => {
618 if !matches!(run.start, Start::List { .. })
619 || run.list_end.is_some()
620 || list_id.catalog_version != 1
621 {
622 self.error = Some("목록 완료 응답이 유효하지 않습니다".into());
623 } else {
624 run.list_end = Some((entry_count, list_id));
625 }
626 }
627 Event::PasswordRequired {
628 challenge_id,
629 attempt,
630 encrypt,
631 } => {
632 if self.challenge.is_some() || challenge_id == 0 {
633 self.error = Some("암호 요청이 유효하지 않습니다".into());
634 } else {
635 self.challenge = Some((challenge_id, attempt, encrypt));
636 }
637 }
638 Event::Progress {
639 stage,
640 processed,
641 total,
642 completed_entries,
643 } => self.progress = Some((stage, processed, total, completed_entries)),
644 Event::Output {
645 relative_name,
646 disposition,
647 ..
648 } => {
649 if self.outputs.len() < 100_000 && relative_name.len() <= 4096 {
650 self.outputs.push((relative_name, disposition));
651 } else {
652 self.error = Some("출력 보고 한도 초과".into());
653 }
654 }
655 Event::CancelAck {
656 request_sequence,
657 status,
658 } => {
659 if run.cancel_sequence == Some(request_sequence) && self.cancel.is_none() {
660 self.cancel = Some(status);
661 } else {
662 self.error = Some("취소 응답이 요청과 일치하지 않습니다".into());
663 }
664 }
665 Event::Terminal(t) => {
666 self.challenge = None;
667 self.terminal = Some(t);
668 }
669 }
670 }
671 }
672 }
673 pub fn status(&self) -> String {
674 if let Some(error) = self.error.as_ref().or(self.input_error.as_ref()) {
675 return error.clone();
676 }
677 if self.busy() {
678 if self.terminal.is_some() {
679 return "작업 결과 수신 / 프로세스 종료 확인 중".into();
680 }
681 if self.challenge.is_some() {
682 return "암호를 입력하세요".into();
683 }
684 if let Some(c) = self.cancel {
685 return match c {
686 CancelStatus::Requested | CancelStatus::AlreadyRequested => {
687 "취소 요청 접수 / 최종 결과 대기"
688 }
689 CancelStatus::TooLate => "취소할 수 없는 단계 / 최종 결과 대기",
690 CancelStatus::Finished => "처리 종료 응답 / 프로세스 종료 확인 중",
691 }
692 .into();
693 }
694 if self
695 .running
696 .as_ref()
697 .is_some_and(|r| r.cancel_sequence.is_some())
698 {
699 return "취소 요청 전송 / 최종 결과 대기".into();
700 }
701 return "작업 중".into();
702 }
703 match self
704 .terminal
705 .as_ref()
706 .filter(|_| self.confirmed)
707 .map(|t| t.outcome)
708 {
709 Some(Outcome::Completed) => "작업 완료",
710 Some(Outcome::Cancelled) => "작업 취소됨",
711 Some(Outcome::Failed) => "작업 실패",
712 None => "압축파일을 열거나 ZIP 파일을 만드세요",
713 }
714 .into()
715 }
716}
717pub fn valid_leaf(name: &str) -> bool {
718 valid_relative(name) && !name.contains('/') && !name.contains('\\')
719}
720pub fn valid_relative(name: &str) -> bool {
721 !name.is_empty()
722 && !name.contains('\0')
723 && !name.contains(':')
724 && !name.starts_with('/')
725 && !name.starts_with('\\')
726 && name
727 .split(['/', '\\'])
728 .all(|p| !p.is_empty() && p != "." && p != "..")
729}
730
731// 파일 연결로 전달된 원형 경로를 손실 변환 없이 보존함.
732pub fn launch_args(
733 args: Vec<std::ffi::OsString>,
734 cwd: PathBuf,
735) -> Result<(bool, Option<PathBuf>), &'static str> {
736 let fixture = args.iter().any(|arg| arg == "--ui-fixture");
737 let paths = args
738 .into_iter()
739 .filter(|arg| arg != "--ui-fixture")
740 .collect::<Vec<_>>();
741 if paths.len() > 1 {
742 return Err("압축파일 하나를 지정하세요");
743 }
744 let path = paths
745 .into_iter()
746 .next()
747 .map(PathBuf::from)
748 .map(|p| if p.is_absolute() { p } else { cwd.join(p) });
749 Ok((fixture, path))
750}
751
752pub fn stage_label(stage: Stage) -> &'static str {
753 match stage {
754 Stage::Scan => "목록 읽는 중",
755 Stage::Read => "파일 읽는 중",
756 Stage::Decode => "압축 푸는 중",
757 Stage::Write => "파일 쓰는 중",
758 Stage::Verify => "검증 중",
759 Stage::Commit => "저장 마무리 중",
760 }
761}
762pub fn disposition_label(disposition: Disposition) -> &'static str {
763 match disposition {
764 Disposition::Created => "생성됨",
765 Disposition::PartialRetained => "일부 파일 남음",
766 Disposition::Removed => "작업 임시 파일 정리됨",
767 Disposition::CommitUncertain => "저장 여부 불확실",
768 }
769}
770pub fn terminal_lines(t: &Terminal) -> Vec<String> {
771 let publication = match t.publication {
772 Publication::None => "게시된 파일 없음",
773 Publication::Partial => "일부 파일 게시됨",
774 Publication::Complete => "파일 게시 완료",
775 Publication::Uncertain => "파일 게시 여부 불확실 / 출력 폴더를 확인하세요",
776 };
777 let durability = match t.durability {
778 Durability::NotApplicable => "동기화 해당 없음",
779 Durability::Synced => "디스크 동기화 완료",
780 Durability::Unconfirmed => "디스크 동기화 미확인",
781 Durability::Failed => "디스크 동기화 실패",
782 };
783 let cleanup = match t.cleanup {
784 Cleanup::Complete => "작업 임시 파일 정리 완료",
785 Cleanup::Failed => "작업 임시 파일 정리 실패",
786 Cleanup::Unconfirmed => "작업 임시 파일 정리 미확인",
787 };
788 let mut lines = vec![
789 publication.into(),
790 format!(
791 "생성 {}개 / 남은 임시 파일 {}개",
792 t.created_count, t.retained_partial_count
793 ),
794 format!("{durability} / {cleanup}"),
795 ];
796 if let Some(error) = t.error {
797 lines.push(
798 match error {
799 ErrorCode::Integrity => "압축파일이 손상됐습니다",
800 ErrorCode::UnsupportedFormat => "지원하지 않는 압축 형식입니다",
801 ErrorCode::UnsupportedFeature => "아직 지원하지 않는 기능입니다",
802 ErrorCode::WrongPassword => "암호가 올바르지 않습니다",
803 ErrorCode::UnsafePath => "안전하지 않은 경로가 있어 중단했습니다",
804 ErrorCode::Conflict => "같은 이름의 파일이 있습니다. 다른 출력 폴더를 선택하세요",
805 ErrorCode::Limit => "처리 한도를 초과했습니다",
806 ErrorCode::Io => "파일을 읽거나 쓰지 못했습니다",
807 ErrorCode::Protocol => "작업자 응답이 올바르지 않습니다",
808 ErrorCode::Internal => "작업자 처리 오류입니다",
809 ErrorCode::SourceChanged => "원본 파일이 바뀌었습니다. 압축파일을 다시 여세요",
810 ErrorCode::InvalidRequest => "입력과 선택한 항목을 확인하세요",
811 }
812 .into(),
813 );
814 }
815 lines
816}