Also uniformed error formatting and cleanup code to have a single place with 
all errors. Before that some warning were popped in from other places.

I've also cleaned up some error messages such as:
```
      | Term.Ignored tm when Term.is_fun (T.deref tm.Term.t) ->
          flush_all () ;
          Format.printf
            "@[<2>%s:@ This term@ would evaluate to@ a function@ \
               which@ would then be dropped.@ \
               This is usually@ the sign@ of@ an unintended@ \
               partial application:@ some arguments@ may \
               be@ missing.@]@."
            (T.print_pos (Utils.get_some tm.Term.t.T.pos)) ;
          raise Error
```
Becomes:
```
      | Term.No_label (f,lbl,first,x) ->
          let pos_f =
            T.print_pos (Utils.get_some f.Term.t.T.pos)
          in
          let pos_x = T.print_pos (Utils.get_some x.Term.t.T.pos) in
          flush_all () ;
          error_header pos_x ;  
          Format.printf "Cannot apply that parameter because the function %s@ 
has %s@ %s!@]@."
              pos_f
              (if first then "no" else "no more")
              (if lbl="" then "unlabeled argument" else
                 Format.sprintf "argument labeled %S" lbl) ;
          raise Error
```
The reasoning is that error messages should be short and concise and then the 
(new) doc should be the point of reference to understand them.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/pull/790#issuecomment-494732528
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to