Skip to content

Commit 22388b0

Browse files
committed
Remove CamelCase for TraceException
to keep things in line with the style of the rest of the code Change-Id: I597ca86c1f67b97d9bb03119cf40ac468454a13f
1 parent 9ed279b commit 22388b0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

trace_container.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*)
77
open Core_kernel.Std
88

9-
exception TraceException of string
9+
exception Trace_exception of string
1010

1111
type frame = Frame_piqi.frame
1212

@@ -125,7 +125,7 @@ class writer ?(arch=default_arch) ?(machine=default_machine) ?(frames_per_toc_en
125125
let s = Frame_piqi_ext.gen_frame frame `pb in
126126
let len = Int64.of_int (String.length s) in
127127
if len <= 0L then
128-
raise (TraceException "Attempt to add zero-length frame to trace");
128+
raise (Trace_exception "Attempt to add zero-length frame to trace");
129129

130130
(* Write the length in binary *)
131131
let () = write_i64 oc len in
@@ -139,7 +139,7 @@ class writer ?(arch=default_arch) ?(machine=default_machine) ?(frames_per_toc_en
139139
= Out_channel.pos oc);
140140

141141
method finish =
142-
if is_finished then raise (TraceException "finish called twice");
142+
if is_finished then raise (Trace_exception "finish called twice");
143143

144144
let toc_offset = Out_channel.pos oc in
145145
(* Make sure the toc is the right size. *)
@@ -181,16 +181,16 @@ class reader filename =
181181
let ic = In_channel.create ~binary:true filename in
182182
(* Verify magic number *)
183183
let () = if read_i64 ic <> magic_number then
184-
raise (TraceException "Magic number is incorrect") in
184+
raise (Trace_exception "Magic number is incorrect") in
185185
(* Trace version *)
186186
let trace_version = read_i64 ic in
187187
let () = if trace_version < lowest_supported_version ||
188188
trace_version > highest_supported_version then
189-
raise (TraceException "Unsupported trace version") in
189+
raise (Trace_exception "Unsupported trace version") in
190190
(* Read arch type, break type safety *)
191191
let archnum = read_i64 ic in
192192
let () = if not (archnum < (Int64.of_int (Obj.magic Arch_bfd.Bfd_arch_last))) then
193-
raise (TraceException "Invalid architecture") in
193+
raise (Trace_exception "Invalid architecture") in
194194
let arch : Arch_bfd.bfd_architecture = Obj.magic (Int64.to_int archnum) in
195195
let machine = read_i64 ic in
196196
(* Read number of trace frames. *)
@@ -250,7 +250,7 @@ class reader filename =
250250
let () = self#check_end_of_trace "get_frame on non-existant frame" in
251251
let frame_len = read_i64 ic in
252252
if (frame_len <= 0L) then
253-
raise (TraceException (Printf.sprintf "Read zero-length frame at offset %#Lx" (LargeFile.pos_in ic)));
253+
raise (Trace_exception (Printf.sprintf "Read zero-length frame at offset %#Lx" (LargeFile.pos_in ic)));
254254
let buf = String.create (Int64.to_int_exn frame_len) in
255255
(* Read the frame info buf. *)
256256
match In_channel.really_input ic ~buf:buf ~pos:0 ~len:(Int64.to_int_exn frame_len) with
@@ -277,11 +277,11 @@ class reader filename =
277277

278278
method private check_end_of_trace_num frame_num msg =
279279
if self#end_of_trace_num frame_num then
280-
raise (TraceException msg)
280+
raise (Trace_exception msg)
281281

282282
method private check_end_of_trace msg =
283283
if self#end_of_trace then
284-
raise (TraceException msg)
284+
raise (Trace_exception msg)
285285

286286
initializer self#seek 0L
287287
end

trace_container.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exception TraceException of string
1+
exception Trace_exception of string
22

33
val default_frames_per_toc_entry : int64
44
val default_auto_finish : bool

0 commit comments

Comments
 (0)