From e27415cf67ba4c976f96067fd1d201999b7692af Mon Sep 17 00:00:00 2001 From: EmileRolley Date: Tue, 20 Jul 2021 14:49:03 +0200 Subject: [PATCH] fix: better error msg for X-token registration This fix the first point of the issue #405. --- src/state/learnocaml_store.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/state/learnocaml_store.ml b/src/state/learnocaml_store.ml index 20ca030e1..06635abcb 100644 --- a/src/state/learnocaml_store.ml +++ b/src/state/learnocaml_store.ml @@ -339,7 +339,9 @@ module Token = struct let register ?(allow_teacher=false) token = if not allow_teacher && is_teacher token then - Lwt.fail (Invalid_argument "Registration of teacher token not allowed") + Lwt.fail + (Invalid_argument "Registration of teacher token forbidden. \ + Logout and use a new teacher token?") else Lwt.catch (fun () -> Lwt_io.with_file ~mode:Lwt_io.Output ~perm:0o700 (save_path token)