         return max
     return n
 
-CellWriteProtectedException = {}
-CellDeleteProtectedException = {}
+# no worries, they don't break react rendering even when they escape
+CellWriteProtectedException = new Error('CellWriteProtectedException')
+CellDeleteProtectedException = new Error('CellDeleteProtectedException')
 
 class exports.JupyterActions extends Actions
 

    set_cell_slide: (id, value) =>
        if not value
            value = null  # delete
        return if @check_edit_protection(id, @)
        @_set
            type  : 'cell'
            id    : id

        @_sync()

    clear_all_outputs: =>
        not_editable = 0
        @store.get('cells').forEach (cell, id) =>
            if cell.get('output')? or cell.get('exec_count')
                if not @store.is_cell_editable(id)
                    not_editable += 1
                else
                    @_set({type:'cell', id:id, output:null, exec_count:null}, false)
            return
        @_sync()
        if not_editable > 0
            @set_error("One or more cells are protected from editing.")

    # prop can be: 'collapsed', 'scrolled'
    toggle_output: (id, prop) =>
