the Failure "hd" exception thrown in some circumstances.
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit.ml,v 1.32 2006/07/31 09:49:42 rich Exp $
+ * $Id: edit.ml,v 1.33 2006/08/01 14:50:47 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
model_to_template !model template
in
- (* Try to save the page. Returns a boolean indicating if the
- * page was saved successfully.
+ (* Try to save the page. Only returns if there were errors in
+ * the model.
*)
let try_save () =
let model = build_internal_model () in
let no_errors = [] = check_for_errors model in
if no_errors then (
(* No errors, so we can save the page ... *)
-
let url, pageid =
try
save_page r dbh hostid ~user model
(* Fill out the conflict template. *)
template_conflict#set "other_diff" other_diff;
template_conflict#set "our_diff" our_diff;
- template_conflict#set "old_version" (Int32.to_string old_version);
- template_conflict#set "new_version" (Int32.to_string new_version);
+ template_conflict#set "old_version"
+ (Int32.to_string old_version);
+ template_conflict#set "new_version"
+ (Int32.to_string new_version);
template_conflict#set "url" url;
q#template template_conflict;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: file.ml,v 1.15 2006/03/27 19:10:29 rich Exp $
+ * $Id: file.ml,v 1.16 2006/08/01 14:50:47 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
and id = $version"
)
with
- Not_found | ExtList.List.Empty_list ->
+ Not_found | ExtList.List.Empty_list | Failure "hd" ->
raise (HttpError cHTTP_NOT_FOUND) in
let deleted = Option.get deleted in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: image.ml,v 1.16 2006/03/27 19:10:29 rich Exp $
+ * $Id: image.ml,v 1.17 2006/08/01 14:50:47 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Option.get data, Option.get mime_type, deleted
)
with
- Not_found | ExtList.List.Empty_list ->
+ Not_found | ExtList.List.Empty_list | Failure "hd" ->
raise (HttpError cHTTP_NOT_FOUND) in
let deleted = Option.get deleted in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_diff.ml,v 1.4 2006/03/27 16:43:44 rich Exp $
+ * $Id: cocanwiki_diff.ml,v 1.5 2006/08/01 14:50:47 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
order by 1 desc limit 1"
)
with
- Not_found | ExtList.List.Empty_list -> 0l in
+ Not_found | ExtList.List.Empty_list | Failure "hd" -> 0l in
(* Get the two versions. *)
let new_page = get_version_for_diff dbh version in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page.ml,v 1.48 2006/07/27 16:46:55 rich Exp $
+ * $Id: page.ml,v 1.49 2006/08/01 14:50:47 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
) in
Some (List.assoc name !extensions)
with
- Not_found | ExtList.List.Empty_list -> None
+ Not_found | ExtList.List.Empty_list | Failure "hd" -> None
in
(* This code generates ordinary pages. *)