19+ results for 'throw.* runtime_error lang:c++' (0 ms)

Not the results you expected?

sc_http_curl.cpp (https://github.com/simulationcraft/simc.git) C++ · 327 lines

43 if ( ssl_proxy )

44 {

45 throw std::runtime_error( "Libcurl does not support HTTPS proxies" );

46 }

47 auto ret = curl_easy_setopt( m_handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );

49 if ( ret != CURLE_OK )

50 {

51 throw std::runtime_error( fmt::format( "Unable to setup proxy: {}", m_error ) );

52 }

53

54 if ( curl_easy_setopt( m_handle, CURLOPT_PROXY, proxy.host.c_str() ) != CURLE_OK )

55 {

56 throw std::runtime_error( fmt::format( "Unable to setup proxy: {}", m_error ) );

57 }

58

KVBinaryOutputStreamSerializer.cpp (https://github.com/ConcealNetwork/conceal-core.git) C++ · 239 lines

32 void writeElementName(IOutputStream& s, Common::StringView name) {

33 if (name.getSize() > std::numeric_limits<uint8_t>::max()) {

34 throw std::runtime_error("Element name is too long");

35 }

36

49 } else {

50 if (val > 4611686018427387903) {

51 throw std::runtime_error("failed to pack varint - too big amount");

52 }

53 return packVarint<uint64_t>(s, PORTABLE_RAW_SIZE_MARK_INT64, val);

test_parser.cpp (https://github.com/Microsoft/krabsetw.git) C++ · 169 lines

65 krabs::parser parser(schema);

66

67 Assert::ExpectException<std::runtime_error>([&]() { parser.parse<int>(L"ContextInfo"); });

68 }

69

sys.cpp (https://github.com/huoji120/Antivirus_R3_bypass_demo.git) C++ · 149 lines

12 {

13 if (BuildNumber < 7601) // Check if OSBuildNumber Is Supported

14 throw std::runtime_error("OS Not Supported.");

15

16 Driver = new gpuz(); // Initialize gpuz.sys IOCTL functions used for reading/writing System Memory

17

18 if (Driver == nullptr)

19 throw std::runtime_error("gpuz Class Object Is Not Initialized.");

20

21 g_CiVar = QueryVar() - 0x100000000; // Query The Global System Variable For Patching

67 HMODULE MappedImage = LoadLibraryExA(szSystemPath, NULL, DONT_RESOLVE_DLL_REFERENCES); // Load the system module to memory

68 if (!MappedImage)

69 throw std::runtime_error("Cannot Load System Image.");

70

71 if (!GetModuleInformation(GetCurrentProcess(), MappedImage, &ModInfo, sizeof(ModInfo))) // Get Information About It

fs.cpp (https://github.com/aseprite/laf.git) C++ · 313 lines

49

50 if (is_file(intermediate))

51 throw std::runtime_error("Error creating directory (a component is a file name)");

52 else if (!is_directory(intermediate))

53 make_directory(intermediate);

EdmondsKarp.cpp (https://github.com/kit-parco/networkit.git) C++ · 126 lines

55

56 void EdmondsKarp::run() {

57 if (!graph->hasEdgeIds()) { throw std::runtime_error("edges have not been indexed - call indexEdges first"); }

58 flow.clear();

59 flow.resize(graph->upperEdgeIdBound(), 0.0);

ScreenControllerFactory.cpp (https://github.com/BlueBrain/Tide.git) C++ · 111 lines

62 const auto connections = parseInputString(ports);

63 if (connections.empty())

64 throw std::runtime_error("Invalid screen controller list: '" +

65 ports.toStdString() + "'");

66

get_config.cc (https://github.com/istio-ecosystem/authservice.git) C++ · 158 lines

23 string error;

24 if (!Validate(config, &error)) {

25 throw std::runtime_error(error);

26 }

27

58 try {

59 parsed_uri = std::make_unique<common::http::Uri>(uri);

60 } catch (std::runtime_error& e) {

61 if (std::string(e.what()).find("uri must be http or https scheme") !=

62 std::string::npos) {

63 throw std::runtime_error(

64 fmt::format("invalid {}: uri must be {} scheme: {}", uri_type,

65 required_scheme, uri));

render_utils.cpp (https://github.com/zilliztech/arctern.git) C++ · 146 lines

112 std::string err_msg =

113 "failed to export to wkt, error code = " + std::to_string(err_code);

114 throw std::runtime_error(err_msg);

115 }

116 CHECK_ARROW(builder.Append(str.data(), str.size()));

cvtFastPerform.cpp (https://github.com/epics-base/epics-base.git) C++ · 357 lines

76 {

77 if ( nConverters >= maxConverters )

78 throw std :: runtime_error ( "Too many converters" );

79

80 converters[ nConverters++ ] = c;

selector.cpp (https://github.com/PRBonn/bonnetal.git) C++ · 68 lines

34 std::cerr << b << std::endl;

35 }

36 throw std::runtime_error("Choose a valid backend");

37 }

38

47 #else

48 // complain

49 throw std::runtime_error("'pytorch' backend implemented but not built.");

50 #endif

51 } else if (lc_backend == "tensorrt") {

55 #else

56 // complain

57 throw std::runtime_error("'tensorrt' backend implemented but not built.");

58 #endif

59 } else {

SDL2.cpp (https://bitbucket.org/sasiedu/nibbler.git) C++ · 181 lines

14

15 if (SDL_Init(SDL_INIT_VIDEO)) {

16 throw std::runtime_error("Could not init video");

17 }

18

19 if (TTF_Init()) {

20 throw std::runtime_error("Could not init font");

21 }

22

25

26 if (this->_window == nullptr) {

27 throw std::runtime_error("Could not create SDL2 window");

28 }

29

untar.cpp (https://gitlab.com/jbandela/ccpm.git) C++ · 183 lines

45 if (t == '5') return entry_type::directory;

46 // Only support files and directories

47 throw std::runtime_error("Invalid entry type");

48

49 }

82 std::string magic;

83 if ((magic = detail::get_magic(h_)) != "ustar" && magic.size()){

84 throw std::runtime_error("Only the ustar format is supported, unsupported format");

85 }

86 }

selector.cpp (https://github.com/PRBonn/rangenet_lib.git) C++ · 57 lines

34 std::cerr << b << std::endl;

35 }

36 throw std::runtime_error("Choose a valid backend");

37 }

38

48 } else {

49 // Should't get here but just in case my logic fails (it mostly does)

50 throw std::runtime_error(backend + " backend not implemented");

51 }

52

KVBinaryOutputStreamSerializer.cpp (https://github.com/AlbertWerner/cryptonotecoin.git) C++ · 239 lines

29 void writeElementName(IOutputStream& s, const std::string& name) {

30 if (name.size() > std::numeric_limits<uint8_t>::max()) {

31 throw std::runtime_error("Element name is too long");

32 }

33 uint8_t len = static_cast<uint8_t>(name.size());

45 } else {

46 if (val > 4611686018427387903) {

47 throw std::runtime_error("failed to pack varint - too big amount");

48 }

49 return packVarint<uint64_t>(s, PORTABLE_RAW_SIZE_MARK_INT64, val);

193 bool KVBinaryOutputStreamSerializer::hasObject(const std::string& name) {

194 assert(false); //the method is not supported for this type of serialization

195 throw std::runtime_error("hasObject method is not supported in KVBinaryOutputStreamSerializer");

196

197 return false;

SimpleStoreMerger.cpp (https://github.com/gekkonerd/hyrise.git) C++ · 186 lines

136

137 if (useValid)

138 throw std::runtime_error("SimpleStoreMerger does not support valid vectors");

139

140

141 if (input_tables.size() != 2)

142 throw std::runtime_error("SimpleStoreMerger does not support more than two tables");

143 auto delta = std::dynamic_pointer_cast<const RawTable>(input_tables[1]);

144 auto main = input_tables[0];

IntegrationMethodRegistry.cpp (https://github.com/ufz/ogs.git) C++ · 214 lines

37 if (wps.back() != meth.getWeightedPoint(ip))

38 {

39 throw std::runtime_error(

40 "createGenericIntegrationMethod mismatch for ip=" +

41 std::to_string(ip) + ", order=" + std::to_string(order) +

main.cpp (https://github.com/jwatte/robotcode.git) C++ · 192 lines

107 default:

108 link->end_receive(sz);

109 throw std::runtime_error("unknown command received from USB: "

110 + hexnum(*ptr));

111 }

uid.cc (https://github.com/ptr/complement.git) C++ · 233 lines

156 }

157

158 const char *hostid_str() throw (runtime_error)

159 {

160 static char b[37] = "";

167 }

168

169 const xmt::uuid_type& hostid() throw (runtime_error)

170 {

171 static detail::__uid_init _uid;

178 }

179

180 std::string uid_str() throw (runtime_error)

181 {

182 char b[37];