lib: construct compactor within try block to catch any exceptions