/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#ifndef FOLLY_EXCEPTIONWRAPPER_H
-#define FOLLY_EXCEPTIONWRAPPER_H
+#pragma once
#include <cassert>
#include <exception>
*
* // Thread2: Exceptions are bad!
* void processResult() {
- * auto ep = globalExceptionWrapper.get();
- * if (!ep.with_exception<FacePlantException>([&](
- * FacePlantException& faceplant) {
- * LOG(ERROR) << "FACEPLANT";
- * })) {
- * ep.with_exception<FailWhaleException>([&](
- * FailWhaleException& failwhale) {
+ * globalExceptionWrapper.with_exception(
+ * [&](FacePlantException& faceplant) {
+ * LOG(ERROR) << "FACEPLANT";
+ * }) ||
+ * globalExceptionWrapper.with_exception(
+ * [&](FailWhaleException& failwhale) {
* LOG(ERROR) << "FAILWHALE!";
- * });
- * }
+ * }) ||
+ * LOG(FATAL) << "Unrecognized exception";
* }
*
*/
}
};
}
-#endif